@Transactional(propagation = Propagation.REQUIRES_NEW) public void persistInstitution(Institution candidateInstitution, boolean isDefault) { Institution institution = institutionDao.getByShortLabel(candidateInstitution.getShortLabel()); CvDatabase intact = daoFactory.getCvObjectDao(CvDatabase.class).getByIdentifier(CvDatabase.INTACT_MI_REF); CvXrefQualifier identity = daoFactory.getCvObjectDao(CvXrefQualifier.class).getByIdentifier(CvXrefQualifier.IDENTITY_MI_REF); if (identity == null && isAutoPersist()){ createCvIfMissing(CvXrefQualifier.class, CvXrefQualifier.IDENTITY_MI_REF, CvXrefQualifier.IDENTITY, null); } if (intact == null && isAutoPersist()){ createCvIfMissing(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT, null); } if (institution == null && isAutoPersist()) { if (log.isDebugEnabled()) log.debug("Persisting institution: "+candidateInstitution); corePersister.saveOrUpdate(candidateInstitution); } else if (isDefault) { if (institution == null) { institution = candidateInstitution; } configuration.setDefaultInstitution(institution); } }
@Transactional(propagation = Propagation.REQUIRES_NEW) public void persistInstitution(Institution candidateInstitution, boolean isDefault) { Institution institution = institutionDao.getByShortLabel(candidateInstitution.getShortLabel()); CvDatabase intact = daoFactory.getCvObjectDao(CvDatabase.class).getByIdentifier(CvDatabase.INTACT_MI_REF); CvXrefQualifier identity = daoFactory.getCvObjectDao(CvXrefQualifier.class).getByIdentifier(CvXrefQualifier.IDENTITY_MI_REF); if (identity == null && isAutoPersist()){ createCvIfMissing(CvXrefQualifier.class, CvXrefQualifier.IDENTITY_MI_REF, CvXrefQualifier.IDENTITY, null); } if (intact == null && isAutoPersist()){ createCvIfMissing(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT, null); } if (institution == null && isAutoPersist()) { if (log.isDebugEnabled()) log.debug("Persisting institution: "+candidateInstitution); corePersister.saveOrUpdate(candidateInstitution); } else if (isDefault) { if (institution == null) { institution = candidateInstitution; } configuration.setDefaultInstitution(institution); } }
CvTopic usedInClass = createCvIfMissing(CvTopic.class, null, CvTopic.USED_IN_CLASS, null); addUsedInClass(usedInClass, usedInClass, CvObject.class.getName()); CvTopic hidden = createCvIfMissing(CvTopic.class, null, CvTopic.HIDDEN, null); addUsedInClass(hidden, usedInClass, CvObject.class.getName()); CvTopic onhold = createCvIfMissing(CvTopic.class, null, CvTopic.ON_HOLD, null); addUsedInClass(onhold, usedInClass, Publication.class.getName() + "," + Experiment.class.getName()); CvTopic correctionComment = createCvIfMissing(CvTopic.class, null, CvTopic.CORRECTION_COMMENT, null); addUsedInClass(correctionComment, usedInClass, Experiment.class.getName());
CvTopic usedInClass = createCvIfMissing(CvTopic.class, null, CvTopic.USED_IN_CLASS, null); addUsedInClass(usedInClass, usedInClass, CvObject.class.getName()); CvTopic hidden = createCvIfMissing(CvTopic.class, null, CvTopic.HIDDEN, null); addUsedInClass(hidden, usedInClass, CvObject.class.getName()); CvTopic onhold = createCvIfMissing(CvTopic.class, null, CvTopic.ON_HOLD, null); addUsedInClass(onhold, usedInClass, Publication.class.getName() + "," + Experiment.class.getName()); CvTopic correctionComment = createCvIfMissing(CvTopic.class, null, CvTopic.CORRECTION_COMMENT, null); addUsedInClass(correctionComment, usedInClass, Experiment.class.getName());