private void synchronizeInteractor( Interactor interactor, boolean synchronizeAnnotatedAtributes ) { if (IntactCore.isInitializedAndDirty(interactor.getActiveInstances())){ Collection<Component> activeInstances = synchronizeCollection(interactor.getActiveInstances()); interactor.getActiveInstances().clear(); interactor.getActiveInstances().addAll(activeInstances); } interactor.setBioSource( synchronize( interactor.getBioSource() ) ); interactor.setCvInteractorType( synchronize( interactor.getCvInteractorType() ) ); if (synchronizeAnnotatedAtributes){ synchronizeAnnotatedObjectCommons( interactor ); } }
private void synchronizeInteractor( Interactor interactor, boolean synchronizeAnnotatedAtributes ) { if (IntactCore.isInitializedAndDirty(interactor.getActiveInstances())){ Collection<Component> activeInstances = synchronizeCollection(interactor.getActiveInstances()); interactor.getActiveInstances().clear(); interactor.getActiveInstances().addAll(activeInstances); } interactor.setBioSource( synchronize( interactor.getBioSource() ) ); interactor.setCvInteractorType( synchronize( interactor.getCvInteractorType() ) ); if (synchronizeAnnotatedAtributes){ synchronizeAnnotatedObjectCommons( interactor ); } }
clone.setCvInteractorType(clone(interactor.getCvInteractorType())); clone.setObjClass(interactor.getObjClass());
clone.setCvInteractorType(clone(interactor.getCvInteractorType())); clone.setObjClass(interactor.getObjClass());
@Override protected T syncAttributes(T intactObject) { if (intactObject.getBioSource() != null) { BioSource syncedBioSource = BioSourcePersister.getInstance().syncIfTransient(intactObject.getBioSource()); intactObject.setBioSource(syncedBioSource); } if (intactObject.getCvInteractorType() != null) { CvInteractorType cvIntType = (CvInteractorType) CvObjectPersister.getInstance().syncIfTransient(intactObject.getCvInteractorType()); intactObject.setCvInteractorType(cvIntType); } if ( intactObject.getActiveInstances() != null ) { Collection<Component> components = new ArrayList<Component>( intactObject.getActiveInstances().size() ); for ( Component component : intactObject.getActiveInstances() ) { final Component c = ComponentPersister.getInstance().syncIfTransient( component ); c.setInteractor( intactObject ); c.setInteraction( component.getInteraction() ); components.add( c ); } intactObject.setActiveInstances( components ); } return super.syncAttributes(intactObject); }