/** * Starts the creation and update of CVs by using the ontology provided * * @param allCvs List of all Cvs * @return An object containing some statistics about the update */ @Transactional @IntactFlushMode(FlushModeType.COMMIT) public CvUpdaterStatistics createOrUpdateCVs( List<CvDagObject> allCvs ) { return createOrUpdateCVs( allCvs, new AnnotationInfoDataset() ); }
@Around("@annotation(intactFlushMode)") public Object switchFlushMode(ProceedingJoinPoint pjp, IntactFlushMode intactFlushMode) throws Throwable{ FlushModeType flushMode = entityManager.getFlushMode(); FlushModeType newFlushMode = intactFlushMode.value(); boolean switchedMode = newFlushMode != flushMode; if (switchedMode) { if (log.isDebugEnabled()) log.debug("Setting flush mode to: "+ newFlushMode); entityManager.setFlushMode(newFlushMode); } Object obj = null; try { obj = pjp.proceed(); } finally { if (switchedMode) { if (log.isDebugEnabled()) log.debug("Resetting back flush mode to: " + flushMode); entityManager.setFlushMode(flushMode); } } return obj; }
@Transactional @IntactFlushMode(FlushModeType.COMMIT) public CvUpdaterStatistics executeUpdate(OBOSession oboSession) throws IOException{ return executeUpdate(oboSession, new AnnotationInfoDataset()); }
@Around("@annotation(intactFlushMode)") public Object switchFlushMode(ProceedingJoinPoint pjp, IntactFlushMode intactFlushMode) throws Throwable{ FlushModeType flushMode = entityManager.getFlushMode(); FlushModeType newFlushMode = intactFlushMode.value(); boolean switchedMode = newFlushMode != flushMode; if (switchedMode) { if (log.isDebugEnabled()) log.debug("Setting flush mode to: "+ newFlushMode); entityManager.setFlushMode(newFlushMode); } Object obj = null; try { obj = pjp.proceed(); } finally { if (switchedMode) { if (log.isDebugEnabled()) log.debug("Resetting back flush mode to: " + flushMode); entityManager.setFlushMode(flushMode); } } return obj; }
@Transactional @IntactFlushMode(FlushModeType.COMMIT) public PersisterStatistics saveOrUpdate( AnnotatedObject... annotatedObjects ) throws PersisterException { for (AnnotatedObject ao : annotatedObjects) { if (log.isDebugEnabled()) log.debug("Saving: "+DebugUtil.annotatedObjectToString(ao, false)); synchronize(ao); } commit(); // we reload the annotated objects by its AC // note: if an object does not have one, it is probably a duplicate for ( AnnotatedObject ao : annotatedObjects ) { reload( ao ); } if (log.isDebugEnabled()) log.debug(statistics); return statistics; }
@Transactional @IntactFlushMode(FlushModeType.COMMIT) public CvUpdaterStatistics executeUpdate(OBOSession oboSession, AnnotationInfoDataset annotationInfoDataset) throws IOException{ CvObjectOntologyBuilder builder = new CvObjectOntologyBuilder(oboSession); return createOrUpdateCVs(builder.getAllCvs(), annotationInfoDataset); }
@Transactional @IntactFlushMode(FlushModeType.COMMIT) public PersisterStatistics saveOrUpdate( AnnotatedObject... annotatedObjects ) throws PersisterException { for (AnnotatedObject ao : annotatedObjects) { if (log.isDebugEnabled()) log.debug("Saving: "+DebugUtil.annotatedObjectToString(ao, false)); synchronize(ao); } commit(); // we reload the annotated objects by its AC // note: if an object does not have one, it is probably a duplicate for ( AnnotatedObject ao : annotatedObjects ) { reload( ao ); } if (log.isDebugEnabled()) log.debug(statistics); return statistics; }
@Transactional @IntactFlushMode(FlushModeType.COMMIT) @Deprecated public PersisterStatistics save( AnnotatedObject... annotatedObjects ) throws PersisterException { CorePersister corePersister = getCorePersister(); corePersister.getStatistics().reset(); corePersister.saveOrUpdate(annotatedObjects); return corePersister.getStatistics(); }
/** * Starts the creation and update of CVs by using the latest available CVs from internet * * @return An object containing some statistics about the update */ @Transactional @IntactFlushMode(FlushModeType.COMMIT) public CvUpdaterStatistics executeUpdateWithLatestCVs() throws IOException{ OBOSession oboSession = null; try { oboSession = OboUtils.createOBOSessionFromLatestMi(); } catch (OBOParseException e) { throw new IOException("Problem creating OBO session from latest MI: "+e.getMessage()); } AnnotationInfoDataset annotationInfoDataset = OboUtils.createAnnotationInfoDatasetFromLatestResource(); return executeUpdate(oboSession, annotationInfoDataset); }
@Transactional @IntactFlushMode(FlushModeType.COMMIT) @Deprecated public PersisterStatistics save( AnnotatedObject... annotatedObjects ) throws PersisterException { CorePersister corePersister = getCorePersister(); corePersister.getStatistics().reset(); corePersister.saveOrUpdate(annotatedObjects); return corePersister.getStatistics(); }
@IntactFlushMode(FlushModeType.COMMIT) public CvUpdaterStatistics createOrUpdateCVs( List<CvDagObject> allValidCvs, AnnotationInfoDataset annotationInfoDataset ) {
@Transactional @IntactFlushMode(FlushModeType.COMMIT) public void saveOrUpdate( User... users ) { for ( User user : users ) {
@Transactional @IntactFlushMode(FlushModeType.COMMIT) public void saveOrUpdate( User... users ) { for ( User user : users ) {