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 ); } }
} else if ( CvInteractorType.SMALL_MOLECULE_MI_REF.equals(typeId)) { interactor = new SmallMoleculeImpl( shortLabel, getInstitution(), interactorType ); interactor.setBioSource( organism ); } else if ( CvInteractorType.NUCLEIC_ACID_MI_REF.equals(typeId) || dnaMis.contains(typeId) || rnaMis.contains(typeId)) { } else if ( CvInteractorType.BIOPOLYMER_MI_REF.equals(typeId)) { interactor = new BioPolymerImpl( shortLabel, getInstitution(), interactorType ); interactor.setBioSource( organism ); } else if ( CvInteractorType.POLYSACCHARIDE_MI_REF.equals(typeId)) { interactor = new PolySaccharideImpl( shortLabel, getInstitution(), interactorType ); interactor.setBioSource( organism ); } else if ( CvInteractorType.UNKNOWN_PARTICIPANT_MI_REF.equals(typeId)) { interactor = new UnknownParticipantImpl( shortLabel, getInstitution(), interactorType ); interactor.setBioSource( organism ); } else { throw new PsiConversionException( "Interactor of unexpected type: " + typeId + " ("+interactorTypeLabel+")" ); } else if ( interactorTypeLabel.equals( CvInteractorType.SMALL_MOLECULE ) ) { interactor = new SmallMoleculeImpl( shortLabel, getInstitution(), interactorType ); interactor.setBioSource( organism ); } else if (CvInteractorType.NUCLEIC_ACID.equals(interactorTypeLabel) || dnaLabels.contains(interactorTypeLabel) || rnaLabels.contains(interactorTypeLabel) ) { } else if ( interactorTypeLabel.equals( CvInteractorType.BIOPOLYMER ) ) { interactor = new BioPolymerImpl( shortLabel, getInstitution(), interactorType ); interactor.setBioSource( organism ); } else if ( interactorTypeLabel.equals( CvInteractorType.POLYSACCHARIDE ) ) { interactor = new PolySaccharideImpl( shortLabel, getInstitution(), interactorType );
clone.setBioSource(clone(interactor.getBioSource())); clone.setCvInteractorType(clone(interactor.getCvInteractorType())); clone.setObjClass(interactor.getObjClass());
clone.setBioSource(clone(interactor.getBioSource())); 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); }
interactor.setBioSource(bioSource);