Tabnine Logo
IntactContext.getDaoFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
getDaoFactory
method
in
uk.ac.ebi.intact.core.context.IntactContext

Best Java code snippets using uk.ac.ebi.intact.core.context.IntactContext.getDaoFactory (Showing top 20 results out of 315)

origin: uk.ac.ebi.intact.core/intact-core

@Override
@Transactional
public Institution convertFromString(String str) {
  if (str == null) return null;
  return IntactContext.getCurrentInstance().getDaoFactory().getInstitutionDao().getByShortLabel(str);
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

public List<String> getInteractionsDrExportNotPassed() {
  DataContext dataContext = IntactContext.getCurrentInstance().getDataContext();
  TransactionStatus transactionStatus = dataContext.beginTransaction();
  Query query = IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().createQuery(interactionsDrExportNotPassed);
  query.setParameter("drExport", CvTopic.UNIPROT_DR_EXPORT);
  query.setParameter("yes", "YES");
  query.setParameter("confidence", AUTHOR_SCORE_MI);
  List<String> interactions = query.getResultList();
  dataContext.commitTransaction(transactionStatus);
  return interactions;
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

public List<String> getInferredInteractions() {
  DataContext dataContext = IntactContext.getCurrentInstance().getDataContext();
  TransactionStatus transactionStatus = dataContext.beginTransaction();
  Query query = IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().createQuery(inferredInteractions);
  query.setParameter("inferred_author", INFERRED_AUTHOR);
  query.setParameter("inferred_curator", CvInteraction.INFERRED_BY_CURATOR_MI_REF);
  List<String> interactions = query.getResultList();
  dataContext.commitTransaction(transactionStatus);
  return interactions;
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

public List<String> getInteractionsFromExperimentNoExport() {
  DataContext dataContext = IntactContext.getCurrentInstance().getDataContext();
  TransactionStatus transactionStatus = dataContext.beginTransaction();
  Query query = IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().createQuery(interactionsFromExperimentNoExport);
  query.setParameter("drExport", CvTopic.UNIPROT_DR_EXPORT);
  query.setParameter("no", "NO");
  List<String> interactions = query.getResultList();
  dataContext.commitTransaction(transactionStatus);
  return interactions;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Checks if the object is managed.
 * @param io the IntactObject
 * @return true is the object is found to be managed, otherwise false.
 */
public static boolean isManaged( IntactObject io ) {
  return IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().contains( io );
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

public List<String> getInteractionsFromExperimentExportSpecified() {
  DataContext dataContext = IntactContext.getCurrentInstance().getDataContext();
  TransactionStatus transactionStatus = dataContext.beginTransaction();
  Query query = IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().createQuery(interactionsFromExperimentExportSpecified);
  query.setParameter("drExport", CvTopic.UNIPROT_DR_EXPORT);
  List<String> interactions = query.getResultList();
  dataContext.commitTransaction(transactionStatus);
  return interactions;
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Checks if the object is managed.
 * @param io the IntactObject
 * @return true is the object is found to be managed, otherwise false.
 */
public static boolean isManaged( IntactObject io ) {
  return IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().contains( io );
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

public List<Object[]> getMethodStatusInIntact() {
  DataContext dataContext = IntactContext.getCurrentInstance().getDataContext();
  TransactionStatus transactionStatus = dataContext.beginTransaction();
  Query query = IntactContext.getCurrentInstance().getDaoFactory().getEntityManager().createQuery(methodStatus);
  query.setParameter("export", CvTopic.UNIPROT_DR_EXPORT);
  List<Object []> methods = query.getResultList();
  dataContext.commitTransaction(transactionStatus);
  return methods;
}
origin: uk.ac.ebi.intact.core/intact-core

public static Institution getInstitution(IntactContext intactContext, User user) {
  Preference preference = user.getPreference(Preference.KEY_INSTITUTION_AC);
  if (preference != null) {
    String institutionAc = preference.getValue();
    return intactContext.getDaoFactory().getInstitutionDao().getByAc(institutionAc);
  }
  return null;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

protected void changeStatus(Publication publication, String cvPublicationStatusIdentifier) {
  IntactContext intactContext = IntactContext.getCurrentInstance();
  final CvObjectDao<CvPublicationStatus> cvObjectDao = intactContext.getDaoFactory().getCvObjectDao( CvPublicationStatus.class );
  CvPublicationStatus publicationStatus = cvObjectDao.getByIdentifier( cvPublicationStatusIdentifier );
  publication.setStatus(publicationStatus);
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public static Institution getInstitution(IntactContext intactContext, User user) {
  Preference preference = user.getPreference(Preference.KEY_INSTITUTION_AC);
  if (preference != null) {
    String institutionAc = preference.getValue();
    return intactContext.getDaoFactory().getInstitutionDao().getByAc(institutionAc);
  }
  return null;
}
origin: uk.ac.ebi.intact.core/intact-core

protected void changeStatus(Publication publication, String cvPublicationStatusIdentifier) {
  IntactContext intactContext = IntactContext.getCurrentInstance();
  final CvObjectDao<CvPublicationStatus> cvObjectDao = intactContext.getDaoFactory().getCvObjectDao( CvPublicationStatus.class );
  CvPublicationStatus publicationStatus = cvObjectDao.getByIdentifier( cvPublicationStatusIdentifier );
  publication.setStatus(publicationStatus);
}
origin: uk.ac.ebi.intact.core/intact-core

public static User getMentorReviewer(IntactContext intactContext, User user) {
  if (user != null) {
    Preference preference = user.getPreference(Preference.KEY_MENTOR_REVIEWER);
    if (preference != null) {
      String mentorAc = preference.getValue();
      return intactContext.getDaoFactory().getUserDao().getByAc(mentorAc);
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public static User getMentorReviewer(IntactContext intactContext, User user) {
  if (user != null) {
    Preference preference = user.getPreference(Preference.KEY_MENTOR_REVIEWER);
    if (preference != null) {
      String mentorAc = preference.getValue();
      return intactContext.getDaoFactory().getUserDao().getByAc(mentorAc);
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.core/intact-core

private SelectionRandomizer<User> createSelectionRandomizer() {
  SelectionRandomizer<User> selectionRandomizer = new SelectionRandomizer<User>();
  List<User> reviewers = IntactContext.getCurrentInstance().getDaoFactory().getUserDao().getByRole(Role.ROLE_REVIEWER);
  for (User reviewer : reviewers) {
    Integer availability = UserUtils.getReviewerAvailability(reviewer);
    selectionRandomizer.addObject(reviewer, availability);
  }
  return selectionRandomizer;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private SelectionRandomizer<User> createSelectionRandomizer() {
  SelectionRandomizer<User> selectionRandomizer = new SelectionRandomizer<User>();
  List<User> reviewers = IntactContext.getCurrentInstance().getDaoFactory().getUserDao().getByRole(Role.ROLE_REVIEWER);
  for (User reviewer : reviewers) {
    Integer availability = UserUtils.getReviewerAvailability(reviewer);
    selectionRandomizer.addObject(reviewer, availability);
  }
  return selectionRandomizer;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private static Collection<Annotation> fetchAnnotations(Interaction interaction) {
  Collection<Annotation> annotations;
  if (IntactCore.isInitialized(interaction.getAnnotations())) {
    annotations = interaction.getAnnotations();
  } else {
    annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(InteractionImpl.class, interaction.getAc());
  }
  return annotations;
}
origin: uk.ac.ebi.intact.core/intact-core

private static Collection<Annotation> fetchAnnotations(Interaction interaction) {
  Collection<Annotation> annotations;
  if (IntactCore.isInitialized(interaction.getAnnotations())) {
    annotations = interaction.getAnnotations();
  } else {
    annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(InteractionImpl.class, interaction.getAc());
  }
  return annotations;
}
origin: uk.ac.ebi.intact.core/intact-core

protected void addLifecycleEvent(Publication publication, String cvLifecycleEventIdentifier, String comment) {
  IntactContext intactContext = IntactContext.getCurrentInstance();
  final CvObjectDao<CvLifecycleEvent> cvObjectDao = intactContext.getDaoFactory().getCvObjectDao( CvLifecycleEvent.class );
  CvLifecycleEvent lifecycleEvent = cvObjectDao.getByIdentifier( cvLifecycleEventIdentifier );
  publication.addLifecycleEvent(new LifecycleEvent(lifecycleEvent, intactContext.getUserContext().getUser(), comment));
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

protected void addLifecycleEvent(Publication publication, String cvLifecycleEventIdentifier, String comment) {
  IntactContext intactContext = IntactContext.getCurrentInstance();
  final CvObjectDao<CvLifecycleEvent> cvObjectDao = intactContext.getDaoFactory().getCvObjectDao( CvLifecycleEvent.class );
  CvLifecycleEvent lifecycleEvent = cvObjectDao.getByIdentifier( cvLifecycleEventIdentifier );
  publication.addLifecycleEvent(new LifecycleEvent(lifecycleEvent, intactContext.getUserContext().getUser(), comment));
}
uk.ac.ebi.intact.core.contextIntactContextgetDaoFactory

Popular methods of IntactContext

  • getCurrentInstance
    Gets the current (ThreadLocal) instance of IntactContext. If no such instance exist, IntAct Core wil
  • getDataContext
  • getInstitution
    Gets the institution from the RuntimeConfig object. In addition, tries to refresh the instance from
  • getCorePersister
  • currentInstanceExists
    Checks if an instance already exists.
  • getSpringContext
  • getLifecycleManager
    Gets the lifecycle manager for publications.
  • getPersisterHelper
  • initContext
    Initializes a standalone context.
  • bindToApplication
  • getApplication
  • getConfig
  • getApplication,
  • getConfig,
  • getConfigurationHandler,
  • getCoreDeleter,
  • getUserContext,
  • initStandaloneContextInMemory,
  • setApplication

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best plugins for Eclipse
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