public UpdateTargetSpecies() { if (getDataContext().isTransactionActive()) { throw new IntactException("Transaction must NOT be active when instantiating UpdateTargetSpecies"); } beginTransaction(); CvObjectDao cvObjectDao = getDataContext().getDaoFactory().getCvObjectDao(); newt = (CvDatabase) cvObjectDao.getByPsiMiRef( CvDatabase.NEWT_MI_REF ); if (newt == null) { throw new IllegalStateException("Cv is null: "+ CvDatabase.NEWT + "("+ CvDatabase.NEWT_MI_REF + ")"); } targetSpeciesQualifier = (CvXrefQualifier) cvObjectDao.getByShortLabel( CvXrefQualifier.class, CvXrefQualifier.TARGET_SPECIES ); if (targetSpeciesQualifier == null) { throw new IllegalStateException("Cv is null: "+ CvXrefQualifier.TARGET_SPECIES); } commitTransaction(); }
.getCvObjectDao().getByPsiMiRef(CvExperimentalRole.BAIT_PSI_REF).getAc();
CvDatabase db = dbDao.getByPsiMiRef( miRef ); if ( db == null ) { String name = taxonomyService.getClass().getSimpleName(); CvXrefQualifier identity = qDao.getByPsiMiRef( CvXrefQualifier.IDENTITY_MI_REF );
/** * TODO: attempt identityXref(mi first and ia next)-cvType and then label-cvType */ @Override protected CvObject fetchFromDataSource( CvObject intactObject ) { // First search by psi-mi identifier CvObjectXref identityXref = CvObjectUtils.getPsiMiIdentityXref(intactObject); if (identityXref != null) { String mi = identityXref.getPrimaryId(); CvObject cvObject = getIntactContext().getDataContext().getDaoFactory() .getCvObjectDao(intactObject.getClass()).getByPsiMiRef(mi); if (cvObject != null) { return cvObject; } } // Failed by MI, try by shortlabel return getIntactContext().getDataContext().getDaoFactory() .getCvObjectDao().getByShortLabel( intactObject.getClass(), intactObject.getShortLabel() ); } }
final CvXrefQualifier identity = qualifierDao.getByPsiMiRef( CvXrefQualifier.IDENTITY_MI_REF );
.getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.IDENTITY_MI_REF); .getCvObjectDao(CvDatabase.class).getByPsiMiRef(CvDatabase.PSI_MI_MI_REF);