/** * Add the loaded current bean to its associated parent. * * Helper method used by Elastic integration when loading with a persistence context. */ public void lazyLoadMany(EntityBean current) { EntityBean parentBean = childMasterProperty.getValueAsEntityBean(current); if (parentBean != null) { addBeanToCollectionWithCreate(parentBean, current, true); } }
@Override public void setLazyLoadedChildBean(EntityBean bean, Object lazyLoadParentId) { if (lazyLoadParentId != null) { if (!lazyLoadParentId.equals(this.lazyLoadParentId)) { // get the appropriate parent bean from the persistence context this.lazyLoadParentBean = (EntityBean) lazyLoadManyProperty.getBeanDescriptor().contextGet(getPersistenceContext(), lazyLoadParentId); this.lazyLoadParentId = lazyLoadParentId; } // add the loadedBean to the appropriate collection of lazyLoadParentBean lazyLoadManyProperty.addBeanToCollectionWithCreate(lazyLoadParentBean, bean, true); } }
/** * Add the loaded current bean to its associated parent. * * Helper method used by Elastic integration when loading with a persistence context. */ public void lazyLoadMany(EntityBean current) { EntityBean parentBean = childMasterProperty.getValueAsEntityBean(current); if (parentBean != null) { addBeanToCollectionWithCreate(parentBean, current, true); } }
@Override public void setLazyLoadedChildBean(EntityBean bean, Object lazyLoadParentId) { if (lazyLoadParentId != null) { if (!lazyLoadParentId.equals(this.lazyLoadParentId)) { // get the appropriate parent bean from the persistence context this.lazyLoadParentBean = (EntityBean) lazyLoadManyProperty.getBeanDescriptor().contextGet(getPersistenceContext(), lazyLoadParentId); this.lazyLoadParentId = lazyLoadParentId; } // add the loadedBean to the appropriate collection of lazyLoadParentBean lazyLoadManyProperty.addBeanToCollectionWithCreate(lazyLoadParentBean, bean, true); } }