#238 - Potential fix for stackOverflow error / recursion issue

This commit is contained in:
rbygrave
2015-02-05 00:06:03 +13:00
parent 8fc3f2da15
commit a447361ea0
3 changed files with 5 additions and 10 deletions
@@ -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);
}