/** * Imports an IntactEntry into intact * * @param entry the intact entry to import * * @return report of the import * * @throws PersisterException thrown if there are problems persisting the data in the intact-model database */ public void importIntoIntact(IntactEntry entry) throws PersisterException { corePersister.saveOrUpdate(entry); }
corePersister.setUpdateWithoutAcEnabled(true); corePersister.saveOrUpdate(cvObjects); PersisterStatistics persisterStats = corePersister.getStatistics();
@Transactional @IntactFlushMode(FlushModeType.COMMIT) @Deprecated public PersisterStatistics save( AnnotatedObject... annotatedObjects ) throws PersisterException { CorePersister corePersister = getCorePersister(); corePersister.getStatistics().reset(); corePersister.saveOrUpdate(annotatedObjects); return corePersister.getStatistics(); }
corePersister.getStatistics().reset();
@Transactional @IntactFlushMode(FlushModeType.COMMIT) @Deprecated public PersisterStatistics save( AnnotatedObject... annotatedObjects ) throws PersisterException { CorePersister corePersister = getCorePersister(); corePersister.getStatistics().reset(); corePersister.saveOrUpdate(annotatedObjects); return corePersister.getStatistics(); }
@Transactional(propagation = Propagation.REQUIRES_NEW) public PersisterStatistics importIntoIntact(Interaction interaction) { return corePersister.saveOrUpdate(interaction); }
private void addUsedInClass(CvObject cv, CvTopic usedInClass, String classes) { final Annotation hiddenAnnotation = new Annotation(usedInClass, classes); cv.addAnnotation(hiddenAnnotation); corePersister.saveOrUpdate(cv); }
private void markAsHidden(CvObject cv, CvTopic hidden) { final Annotation hiddenAnnotation = new Annotation(hidden, null); cv.addAnnotation(hiddenAnnotation); corePersister.saveOrUpdate(cv); }
private void addUsedInClass(CvObject cv, CvTopic usedInClass, String classes) { final Annotation hiddenAnnotation = new Annotation(usedInClass, classes); cv.addAnnotation(hiddenAnnotation); corePersister.saveOrUpdate(cv); }
private void markAsHidden(CvObject cv, CvTopic hidden) { final Annotation hiddenAnnotation = new Annotation(hidden, null); cv.addAnnotation(hiddenAnnotation); corePersister.saveOrUpdate(cv); }
private <T extends CvObject> T createCvIfMissing( Class<T> clazz, String cvId, String cvName, CvDagObject parent ) { T cv = daoFactory.getCvObjectDao(clazz).getByIdentifier(cvId); if ( cv == null) { cv = CvObjectUtils.createCvObject(configuration.getDefaultInstitution(), clazz, cvId, cvName ); corePersister.saveOrUpdate(cv); if( parent != null && cv instanceof CvDagObject ) { CvDagObject cvDag = (CvDagObject) cv; cvDag.addParent( parent ); } } return cv; }
@Transactional(propagation = Propagation.REQUIRED) public void updateChildrenHavingMissingParent(String child, String parent) { CvObjectDao<CvDagObject> cvDao = IntactContext.getCurrentInstance().getDaoFactory().getCvObjectDao(CvDagObject.class); CvDagObject reloadedChild = cvDao.getByAc(child); CvDagObject reloadedParent = cvDao.getByAc(parent); if (reloadedChild != null){ reloadedChild.addParent(reloadedParent); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(reloadedChild); } else { log.warn("Cv object " + child + " cannot be updated because does not exist anymore"); } }
private <T extends CvObject> T createCvIfMissing( Class<T> clazz, String cvId, String cvName, CvDagObject parent ) { T cv = daoFactory.getCvObjectDao(clazz).getByIdentifier(cvId); if ( cv == null) { cv = CvObjectUtils.createCvObject(configuration.getDefaultInstitution(), clazz, cvId, cvName ); corePersister.saveOrUpdate(cv); if( parent != null && cv instanceof CvDagObject ) { CvDagObject cvDag = (CvDagObject) cv; cvDag.addParent( parent ); } } return cv; }
private <T extends CvObject> T createIntactCvIfMissing( Class<T> clazz, String cvId, String cvName, CvDagObject parent ) { T cv = daoFactory.getCvObjectDao(clazz).getByIdentifier(cvId); if ( cv == null) { cv = CvObjectUtils.createIntactCvObject(configuration.getDefaultInstitution(), clazz, cvId, cvName ); corePersister.saveOrUpdate(cv); if( parent != null && cv instanceof CvDagObject ) { CvDagObject cvDag = (CvDagObject) cv; cvDag.addParent( parent ); } } return cv; }
private <T extends CvObject> T createIntactCvIfMissing( Class<T> clazz, String cvId, String cvName, CvDagObject parent ) { T cv = daoFactory.getCvObjectDao(clazz).getByIdentifier(cvId); if ( cv == null) { cv = CvObjectUtils.createIntactCvObject(configuration.getDefaultInstitution(), clazz, cvId, cvName ); corePersister.saveOrUpdate(cv); if( parent != null && cv instanceof CvDagObject ) { CvDagObject cvDag = (CvDagObject) cv; cvDag.addParent( parent ); } } return cv; }
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(usedInClass);
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(aliasType);
/** * Add the dataset annotation for each experiment in the list * @param publications : the publications */ private void addDatasetToExperimentsAndPublication(List<Publication> publications) throws IOException, DatasetException { for (Publication p : publications){ if (!processedPublications.contains(p.getAc()) && isPublicationEligibleForDataset(p)){ processedPublications.add(p.getAc()); String pubId = p.getShortLabel(); // if publication has not been processed, we add the dataset to the publication if (this.listOfpublicationUpdated.add(pubId)){ Annotation annotation = createNewDataset(); log.info("Add dataset to " + p.getAc() + ": " + p.getShortLabel()); p.addAnnotation(annotation); for (Experiment exp : p.getExperiments()){ Annotation annotation2 = createNewDataset(); log.info("Add dataset to " + exp.getAc() + ": " + exp.getShortLabel()); exp.addAnnotation(annotation2); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(exp); } IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(p); } } } }
IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(importedParent); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(dagObject); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(cvChild);
@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); } }