mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-25 07:57:39 +00:00
#238 - Potential fix for stackOverflow error / recursion issue
This commit is contained in:
@@ -47,9 +47,6 @@ public final class EntityBeanIntercept implements Serializable {
|
||||
*/
|
||||
private EntityBean owner;
|
||||
|
||||
/**
|
||||
* The parent bean by relationship (1-1 or 1-M).
|
||||
*/
|
||||
private EntityBean embeddedOwner;
|
||||
private int embeddedOwnerIndex;
|
||||
|
||||
@@ -175,7 +172,7 @@ public final class EntityBeanIntercept implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the parent bean (by relationship).
|
||||
* Return the owning bean for an embedded bean.
|
||||
*/
|
||||
public Object getEmbeddedOwner() {
|
||||
return embeddedOwner;
|
||||
@@ -189,8 +186,7 @@ public final class EntityBeanIntercept implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Special case for a OneToOne, Set the parent bean (by relationship). This is
|
||||
* the owner of a 1-1.
|
||||
* Set the embedded beans owning bean.
|
||||
*/
|
||||
public void setEmbeddedOwner(EntityBean parentBean, int embeddedOwnerIndex) {
|
||||
this.embeddedOwner = parentBean;
|
||||
|
||||
@@ -519,7 +519,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
|
||||
@Override
|
||||
public void setValue(EntityBean bean, Object value) {
|
||||
super.setValue(bean, value);
|
||||
if (value instanceof EntityBean) {
|
||||
if (embedded && value instanceof EntityBean) {
|
||||
EntityBean embedded = (EntityBean)value;
|
||||
embedded._ebean_getIntercept().setEmbeddedOwner(bean, propertyIndex);
|
||||
}
|
||||
@@ -528,7 +528,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
|
||||
@Override
|
||||
public void setValueIntercept(EntityBean bean, Object value) {
|
||||
super.setValueIntercept(bean, value);
|
||||
if (value instanceof EntityBean) {
|
||||
if (embedded && value instanceof EntityBean) {
|
||||
EntityBean embedded = (EntityBean)value;
|
||||
embedded._ebean_getIntercept().setEmbeddedOwner(bean, propertyIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user