/** * 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); } }
/** * 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); } }
/** * Save any associated one beans. */ private void saveAssocOne(PersistRequestBean<?> request) { BeanDescriptor<?> desc = request.getBeanDescriptor(); // imported ones with save cascade for (BeanPropertyAssocOne<?> prop : desc.propertiesOneImportedSave()) { // check for partial objects if (prop.isOrphanRemoval() && request.isDirtyProperty(prop)) { request.setImportedOrphanForRemoval(prop); } if (request.isLoadedProperty(prop)) { EntityBean detailBean = prop.getValueAsEntityBean(request.getEntityBean()); if (detailBean != null && !prop.isSaveRecurseSkippable(detailBean) && !prop.isReference(detailBean) && !request.isParent(detailBean)) { SpiTransaction t = request.getTransaction(); t.depth(-1); saveRecurse(detailBean, t, null, request.getFlags()); t.depth(+1); } } } for (BeanPropertyAssocOne<?> prop : desc.propertiesOneExportedSave()) { if (prop.isOrphanRemoval() && request.isDirtyProperty(prop)) { deleteOrphan(request, prop); } } }
EntityBean detailBean = prop.getValueAsEntityBean(parentBean); if (detailBean != null) { if (!prop.isSaveRecurseSkippable(detailBean)) {
/** * Save any associated one beans. */ private void saveAssocOne(PersistRequestBean<?> request) { BeanDescriptor<?> desc = request.getBeanDescriptor(); // imported ones with save cascade for (BeanPropertyAssocOne<?> prop : desc.propertiesOneImportedSave()) { // check for partial objects if (prop.isOrphanRemoval() && request.isDirtyProperty(prop)) { request.setImportedOrphanForRemoval(prop); } if (request.isLoadedProperty(prop)) { EntityBean detailBean = prop.getValueAsEntityBean(request.getEntityBean()); if (detailBean != null && !prop.isSaveRecurseSkippable(detailBean) && !prop.isReference(detailBean) && !request.isParent(detailBean)) { SpiTransaction t = request.getTransaction(); t.depth(-1); saveRecurse(detailBean, t, null, request.getFlags()); t.depth(+1); } } } for (BeanPropertyAssocOne<?> prop : desc.propertiesOneExportedSave()) { if (prop.isOrphanRemoval() && request.isDirtyProperty(prop)) { deleteOrphan(request, prop); } } }
EntityBean detailBean = prop.getValueAsEntityBean(parentBean); if (detailBean != null) { if (!prop.isSaveRecurseSkippable(detailBean)) {