Tabnine Logo
IntactFlushMode
Code IndexAdd Tabnine to your IDE (free)

How to use
IntactFlushMode
in
uk.ac.ebi.intact.core.annotations

Best Java code snippets using uk.ac.ebi.intact.core.annotations.IntactFlushMode (Showing top 13 results out of 315)

origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

/**
 * 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() );
}
origin: uk.ac.ebi.intact.core/intact-core

@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;
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

@Transactional
@IntactFlushMode(FlushModeType.COMMIT)
public CvUpdaterStatistics executeUpdate(OBOSession oboSession) throws IOException{
   return executeUpdate(oboSession, new AnnotationInfoDataset());
 }
origin: uk.ac.ebi.intact.core/intact-core-readonly

@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;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

@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;
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

@Transactional
@IntactFlushMode(FlushModeType.COMMIT)
public CvUpdaterStatistics executeUpdate(OBOSession oboSession, AnnotationInfoDataset annotationInfoDataset) throws IOException{
   CvObjectOntologyBuilder builder = new CvObjectOntologyBuilder(oboSession);
   return createOrUpdateCVs(builder.getAllCvs(), annotationInfoDataset);
}
origin: uk.ac.ebi.intact.core/intact-core

@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;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

@Transactional
@IntactFlushMode(FlushModeType.COMMIT)
@Deprecated
public PersisterStatistics save( AnnotatedObject... annotatedObjects ) throws PersisterException {
  CorePersister corePersister = getCorePersister();
  corePersister.getStatistics().reset();
  corePersister.saveOrUpdate(annotatedObjects);
  return corePersister.getStatistics();
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

 /**
 * 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);
 }
origin: uk.ac.ebi.intact.core/intact-core

@Transactional
@IntactFlushMode(FlushModeType.COMMIT)
@Deprecated
public PersisterStatistics save( AnnotatedObject... annotatedObjects ) throws PersisterException {
  CorePersister corePersister = getCorePersister();
  corePersister.getStatistics().reset();
  corePersister.saveOrUpdate(annotatedObjects);
  return corePersister.getStatistics();
}
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

@IntactFlushMode(FlushModeType.COMMIT)
public CvUpdaterStatistics createOrUpdateCVs( List<CvDagObject> allValidCvs, AnnotationInfoDataset annotationInfoDataset ) {
origin: uk.ac.ebi.intact.core/intact-core-readonly

@Transactional
@IntactFlushMode(FlushModeType.COMMIT)
public void saveOrUpdate( User... users ) {
  for ( User user : users ) {
origin: uk.ac.ebi.intact.core/intact-core

@Transactional
@IntactFlushMode(FlushModeType.COMMIT)
public void saveOrUpdate( User... users ) {
  for ( User user : users ) {
uk.ac.ebi.intact.core.annotationsIntactFlushMode

Most used methods

  • <init>
  • value

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • BoxLayout (javax.swing)
  • JPanel (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now