Protein result = getDaoFactory().getProteinDao().getByAc( ac ); if ( result == null ) { Interaction result = getDaoFactory().getInteractionDao().getByAc( ac ); if ( result == null ) { Experiment result = getDaoFactory().getExperimentDao().getByAc( ac ); if ( result == null ) { CvObject result = getDaoFactory().getCvObjectDao( CvObject.class ).getByAc( ac ); if ( result == null ) { BioSource result = getDaoFactory().getBioSourceDao().getByAc( ac ); if ( result == null ) {
AnnotatedObjectDao<? extends AnnotatedObject> dao = getDaoFactory().getAnnotatedObjectDao( mappedClass ); value ); Collection<Alias> aliases = getDaoFactory().getAliasDao( Alias.class ).getByNameLike( value ); value ); Collection<Xref> xrefs = getDaoFactory().getXrefDao().getByPrimaryIdLike( value );
BaseDao dao = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getBaseDao(); System.out.println( "Database: " + dao.getDbName() ); System.out.println( "Username: " + IntactContext.getCurrentInstance().getUserContext().getUserId() ); System.out.print( "Loading " + label + "..." ); System.out.flush(); experiments.addAll( IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getExperimentDao().getByShortLabelLike(label)); System.out.println( "done." );
if ( !daoFactory.isTransactionActive() ) { log.debug( "There's no transaction active, start a local transaction." ); transaction = daoFactory.beginTransaction(); } else { log.debug( "There's already an ongoing transaction, we join it." ); BioSourceDao bsDao = daoFactory.getBioSourceDao(); BioSource biosource = bsDao.getByTaxonIdUnique( taxid );
System.out.println( "Database: " + daoFactory.getBaseDao().getDbName() ); System.out.println( "User: " + daoFactory.getBaseDao().getDbUserName() ); CvTopic topic = daoFactory.getCvObjectDao( CvTopic.class ).getByShortLabel( "author-confidence" ); IntactContext.getCurrentInstance().getDataContext().commitTransaction();
throws IntactException { ExperimentDao expDao = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getExperimentDao(); Institution institution = IntactContext.getCurrentInstance().getInstitution(); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( primaryXref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( seeAlsoXref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref );
public CvObject getByAc( String ac, boolean forceReload ) { if ( !forceReload && cachedByAc.containsKey( ac ) ) { return cachedByAc.get( ac ); } CvObject cvObject = getDaoFactory().getCvObjectDao().getByAc( ac ); if ( cvObject == null ) { return null; } putCv( cvObject ); return cvObject; }
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().persist((InteractionImpl) interaction ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation ); GoXrefHelper goXrefHelper = new GoXrefHelper( xrefTag.getId() ); if ( goXrefHelper.getQualifier() != null ) { cvXrefQualifier = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvXrefQualifier.class).getByShortLabel(goXrefHelper.getQualifier()); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref ); Collection _annotations = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().getByDescriptionLike(confidence.getValue()); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().update( (InteractionImpl) interaction );
private Collection<Experiment> getExperiments( int firstResult, int maxResults ) { output.println( "Retrieving data from DB store, from " + firstResult ); if ( searchPattern.contains( "," ) ) { throw new IntactException( "Lists with comma-separated experiments are not accepted anymore" ); } Collection<Experiment> searchResults = getDaoFactory().getExperimentDao().getByShortLabelLike( searchPattern, true, firstResult, maxResults, true ); int resultSize = searchResults.size(); output.println( "done (retrieved " + resultSize + " experiment" + ( resultSize > 1 ? "s" : "" ) + ")" ); return searchResults; }
if ( !daoFactory.isTransactionActive() ) { log.debug( "There's no transaction active, start a local transaction." ); transaction = daoFactory.beginTransaction(); } else { log.debug( "There's already an ongoing transaction, we join it." ); CvObjectDao<CvDatabase> dbDao = daoFactory.getCvObjectDao( CvDatabase.class ); String miRef = taxonomyService.getSourceDatabaseMiRef(); CvDatabase db = dbDao.getByPsiMiRef( miRef ); CvObjectDao<CvXrefQualifier> qDao = daoFactory.getCvObjectDao( CvXrefQualifier.class ); CvXrefQualifier identity = qDao.getByPsiMiRef( CvXrefQualifier.IDENTITY_MI_REF ); BioSourceDao sourceDao = daoFactory.getBioSourceDao(); sourceDao.saveOrUpdate( bioSource );
Collection proteins = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getProteinDao().getByXrefLike(proteinId); CvInteractorType proteinType = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvInteractorType.class).getByXref(CvInteractorType.getProteinMI()); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getProteinDao().persist( (ProteinImpl)protein ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation ); proteinType.addAnnotation( annotation ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getProteinDao().update( (ProteinImpl)protein );
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getFeatureDao().persist( feature ); qualifier ); feature.addXref( xref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getRangeDao().persist( range );
.getCvObjectDao(clazz).persist(cv); log.debug("Created missing CV Term: " + clazz.getSimpleName() + "( " + cv.getShortLabel() + " - " + cv.getFullName() + " )."); getDaoFactory().getXrefDao().persist(xref); log.debug("Added required PSI Xref to " + shortlabel + ": " + mi);
public GeneratedEntry addInteractionWithShortLabel(String shortLabel) { Interaction interaction = intactContext.getDataContext().getDaoFactory() .getInteractionDao().getByShortLabel(shortLabel); checkResult(interaction, shortLabel, "interaction"); return addInteraction(interaction); }
experiment = getDataContext().getDaoFactory().getExperimentDao().getByAc(experiment.getAc()); experiment = getDataContext().getDaoFactory().getExperimentDao().getByAc(experiment.getAc()); if (experimentXref.getPrimaryId().equals(bioSourceToRemove.getTaxId())) { iterator.remove(); getDataContext().getDaoFactory().getXrefDao(ExperimentXref.class).delete(experimentXref); break;
log.debug( "\t\tReplicating " + institution.getClass().getSimpleName() + ": " + institution.getShortLabel()+ " (AC:"+ institution.getAc() +")" ); getDaoFactory().getInstitutionDao().replicate(institution); } else { if ( log.isDebugEnabled() ) { log.debug( "\t\tPersisting " + institution.getClass().getSimpleName() + ": " + institution.getShortLabel() ); getDaoFactory().getInstitutionDao().persist(institution); getDaoFactory().getCvObjectDao().merge(cv); } else { if ( log.isDebugEnabled() ) { log.debug( "\t\tPersisting " + cv.getClass().getSimpleName() + ": " + cv.getShortLabel() ); getDaoFactory().getCvObjectDao().persist(cv); getDaoFactory().getAnnotatedObjectDao((Class<AnnotatedObject>)ao.getClass()).persist(ao); log.debug( "\t\tMerging " + ao.getClass().getSimpleName() + ": " + ao.getShortLabel()+ " (AC: "+ ao.getAc() +")" ); getDaoFactory().getAnnotatedObjectDao((Class<AnnotatedObject>)ao.getClass()).merge(ao); logPersistence(ao);
Collection<ProteinImpl> proteins = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getProteinDao().getByShortLabelLike("%afcs%");
/** * Loads all CvTopics that should not be shown on the public interface. */ private AnnotationFilter() { logger.debug( "Initializing which CvTopic should be filtered out." ); // search for the CvTopic no-export CvTopic noExport = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotatedObjectDao( CvTopic.class ).getByShortLabel( CvTopic.NO_EXPORT ); if ( noExport != null ) { // load all CvTopics Collection<CvTopic> cvTopics = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao( CvTopic.class ).getAll(); // select those that have an Annotation( no-export ) for ( CvTopic cvTopic : cvTopics ) { for ( Annotation annotation : cvTopic.getAnnotations() ) { if ( noExport.equals( annotation.getCvTopic() ) ) { if ( filteredTopics == null ) { filteredTopics = new HashSet<CvTopic>( 8 ); } logger.debug( "CvTopic( " + cvTopic.getShortLabel() + " )" ); filteredTopics.add( cvTopic ); } } } } if ( filteredTopics == null ) { filteredTopics = Collections.EMPTY_SET; } logger.debug( filteredTopics.size() + " CvTopic" + ( filteredTopics.size() > 1 ? "s" : "" ) + " filtered." ); }
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().update( xref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getBioSourceDao().update( bioSource );
private Connection getConnection() { BaseDao dao = daoFactory.getBaseDao(); con = ((Session) dao.getSession()).connection(); return con; }