public <T extends InteractorImpl> InteractorDao<T> getInteractorDao( Class<T> entityType ) { InteractorDao interactorDao = getBean(InteractorDaoImpl.class); interactorDao.setEntityClass(entityType); return interactorDao; }
int countOfParticipants = intactContext.getDaoFactory().getInteractorDao().countComponentsForInteractorWithAc(child.getAc()); if (countOfParticipants > 0){ throw new IntactObjectDeleteException("The interactor " + child.getAc() + " cannot be deleted because it is still used in " + countOfParticipants + " participants."); int countOfInteractors = intactContext.getDaoFactory().getInteractorDao().getByBioSourceAc(child.getAc()).size(); if ( countOfInteractors > 0){ throw new IntactObjectDeleteException("The bioSource " + child.getAc() + " cannot be deleted because it is still used in " + countOfInteractors + " interactors.");
public GeneratedEntry addInteractorWithShortLabel(String shortLabel) { Interactor interactor = intactContext.getDataContext().getDaoFactory() .getInteractorDao().getByShortLabel(shortLabel); checkResult(interactor, shortLabel, "interactor"); return addInteractor(interactor); }
public GeneratedEntry addInteractorWithAc(String ac) { Interactor interactor = intactContext.getDataContext().getDaoFactory() .getInteractorDao().getByAc(ac); checkResult(interactor, ac, "interactor"); return addInteractor(interactor); }
/** * Prints the most counts in the database. * @param ps The printStream to use * * @since 1.9.0 */ public static void printDatabaseCounts(PrintStream ps) { final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory(); ps.println("Publications: "+ daoFactory.getPublicationDao().countAll()); ps.println("\tXrefs: "+ daoFactory.getXrefDao(PublicationXref.class).countAll()); ps.println("\tAliases: "+ daoFactory.getAliasDao(PublicationAlias.class).countAll()); ps.println("Experiments: "+ daoFactory.getExperimentDao().countAll()); ps.println("\tXrefs: "+ daoFactory.getXrefDao(ExperimentXref.class).countAll()); ps.println("\tAliases: "+ daoFactory.getAliasDao(ExperimentAlias.class).countAll()); ps.println("Interactors: "+ daoFactory.getInteractorDao().countAll()); ps.println("\tInteractions: "+ daoFactory.getInteractionDao().countAll()); ps.println("\tPolymers: " + daoFactory.getPolymerDao().countAll()); ps.println("\t\tProteins: "+ daoFactory.getProteinDao().countAll()); ps.println("\t\tNucleic Acids: "+ daoFactory.getInteractorDao(NucleicAcidImpl.class).countAll()); ps.println("\tSmall molecules: " + daoFactory.getInteractorDao(SmallMoleculeImpl.class).countAll()); ps.println("\tInteractor Xrefs: "+ daoFactory.getXrefDao(InteractorXref.class).countAll()); ps.println("\tInteractor Aliases: "+ daoFactory.getAliasDao(InteractorAlias.class).countAll()); ps.println("Components: "+ daoFactory.getComponentDao().countAll()); ps.println("Features: "+ daoFactory.getFeatureDao().countAll()); ps.println("\tRanges: "+ daoFactory.getRangeDao().countAll()); ps.println("CvObjects: "+ daoFactory.getCvObjectDao().countAll()); ps.println("BioSources: "+ daoFactory.getBioSourceDao().countAll()); ps.println("Annotations: "+ daoFactory.getAnnotationDao().countAll()); ps.println("Institutions: "+ daoFactory.getInstitutionDao().countAll()); }
Collection<InteractorImpl> interactors = daoFactory.getInteractorDao().getByShortLabelLike(name); interactors = daoFactory.getInteractorDao().getByShortLabelLike(name + '%');
int countOfParticipants = intactContext.getDaoFactory().getInteractorDao().countComponentsForInteractorWithAc(child.getAc()); if (countOfParticipants > 0){ throw new IntactObjectDeleteException("The interactor " + child.getAc() + " cannot be deleted because it is still used in " + countOfParticipants + " participants."); int countOfInteractors = intactContext.getDaoFactory().getInteractorDao().getByBioSourceAc(child.getAc()).size(); if ( countOfInteractors > 0){ throw new IntactObjectDeleteException("The bioSource " + child.getAc() + " cannot be deleted because it is still used in " + countOfInteractors + " interactors.");
public GeneratedEntry addInteractorWithShortLabel(String shortLabel) { Interactor interactor = intactContext.getDataContext().getDaoFactory() .getInteractorDao().getByShortLabel(shortLabel); checkResult(interactor, shortLabel, "interactor"); return addInteractor(interactor); }
public GeneratedEntry addInteractorWithAc(String ac) { Interactor interactor = intactContext.getDataContext().getDaoFactory() .getInteractorDao().getByAc(ac); checkResult(interactor, ac, "interactor"); return addInteractor(interactor); }
/** * Prints the most counts in the database. * @param ps The printStream to use * * @since 1.9.0 */ public static void printDatabaseCounts(PrintStream ps) { final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory(); ps.println("Publications: "+ daoFactory.getPublicationDao().countAll()); ps.println("\tXrefs: "+ daoFactory.getXrefDao(PublicationXref.class).countAll()); ps.println("\tAliases: "+ daoFactory.getAliasDao(PublicationAlias.class).countAll()); ps.println("Experiments: "+ daoFactory.getExperimentDao().countAll()); ps.println("\tXrefs: "+ daoFactory.getXrefDao(ExperimentXref.class).countAll()); ps.println("\tAliases: "+ daoFactory.getAliasDao(ExperimentAlias.class).countAll()); ps.println("Interactors: "+ daoFactory.getInteractorDao().countAll()); ps.println("\tInteractions: "+ daoFactory.getInteractionDao().countAll()); ps.println("\tPolymers: " + daoFactory.getPolymerDao().countAll()); ps.println("\t\tProteins: "+ daoFactory.getProteinDao().countAll()); ps.println("\t\tNucleic Acids: "+ daoFactory.getInteractorDao(NucleicAcidImpl.class).countAll()); ps.println("\tSmall molecules: " + daoFactory.getInteractorDao(SmallMoleculeImpl.class).countAll()); ps.println("\tInteractor Xrefs: "+ daoFactory.getXrefDao(InteractorXref.class).countAll()); ps.println("\tInteractor Aliases: "+ daoFactory.getAliasDao(InteractorAlias.class).countAll()); ps.println("Components: "+ daoFactory.getComponentDao().countAll()); ps.println("Features: "+ daoFactory.getFeatureDao().countAll()); ps.println("\tRanges: "+ daoFactory.getRangeDao().countAll()); ps.println("CvObjects: "+ daoFactory.getCvObjectDao().countAll()); ps.println("BioSources: "+ daoFactory.getBioSourceDao().countAll()); ps.println("Annotations: "+ daoFactory.getAnnotationDao().countAll()); ps.println("Institutions: "+ daoFactory.getInstitutionDao().countAll()); }
Interactor existingObject = interactorDao.getByShortLabel(interactor.getShortLabel()); if (existingObject != null) { ac = existingObject.getAc();
public <T extends InteractorImpl> InteractorDao<T> getInteractorDao( Class<T> entityType ) { InteractorDao interactorDao = getBean(InteractorDaoImpl.class); interactorDao.setEntityClass(entityType); return interactorDao; }
Interactor existingObject = interactorDao.getByShortLabel(interactor.getShortLabel()); if (existingObject != null) { ac = existingObject.getAc();