congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
AnnotationDao
Code IndexAdd Tabnine to your IDE (free)

How to use
AnnotationDao
in
uk.ac.ebi.intact.core.persistence.dao

Best Java code snippets using uk.ac.ebi.intact.core.persistence.dao.AnnotationDao (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

@Transactional(propagation = Propagation.REQUIRES_NEW)
/**
 * Delete hidden annotations for each cv given in the collection
 */
public void removeHiddenFrom(Collection<CvObject> cvs){
  DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory();
  AnnotationDao annDao = factory.getAnnotationDao();
  for (CvObject cv : cvs){
    cv = factory.getEntityManager().merge(cv);
    Collection<Annotation> annotations = new ArrayList<Annotation>(cv.getAnnotations());
    for (Annotation annotation : annotations){
      if (annotation.getCvTopic() != null && CvTopic.HIDDEN.equalsIgnoreCase(annotation.getCvTopic().getShortLabel())){
        cv.removeAnnotation(annotation);
        annDao.delete(annotation);
      }
    }
  }
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Prints the most counts in the database.
 * @param ps The printStream to use
 *
 * @since 1.9.0
 */
public static void printDatabaseCounts(PrintStream ps) {
  final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory();
  ps.println("Publications: "+ daoFactory.getPublicationDao().countAll());
  ps.println("\tXrefs: "+ daoFactory.getXrefDao(PublicationXref.class).countAll());
  ps.println("\tAliases: "+ daoFactory.getAliasDao(PublicationAlias.class).countAll());
  ps.println("Experiments: "+ daoFactory.getExperimentDao().countAll());
  ps.println("\tXrefs: "+ daoFactory.getXrefDao(ExperimentXref.class).countAll());
  ps.println("\tAliases: "+ daoFactory.getAliasDao(ExperimentAlias.class).countAll());
  ps.println("Interactors: "+ daoFactory.getInteractorDao().countAll());
  ps.println("\tInteractions: "+ daoFactory.getInteractionDao().countAll());
  ps.println("\tPolymers: " + daoFactory.getPolymerDao().countAll());
  ps.println("\t\tProteins: "+ daoFactory.getProteinDao().countAll());
  ps.println("\t\tNucleic Acids: "+ daoFactory.getInteractorDao(NucleicAcidImpl.class).countAll());
  ps.println("\tSmall molecules: " + daoFactory.getInteractorDao(SmallMoleculeImpl.class).countAll());
  ps.println("\tInteractor Xrefs: "+ daoFactory.getXrefDao(InteractorXref.class).countAll());
  ps.println("\tInteractor Aliases: "+ daoFactory.getAliasDao(InteractorAlias.class).countAll());
  ps.println("Components: "+ daoFactory.getComponentDao().countAll());
  ps.println("Features: "+ daoFactory.getFeatureDao().countAll());
  ps.println("\tRanges: "+ daoFactory.getRangeDao().countAll());
  ps.println("CvObjects: "+ daoFactory.getCvObjectDao().countAll());
  ps.println("BioSources: "+ daoFactory.getBioSourceDao().countAll());
  ps.println("Annotations: "+ daoFactory.getAnnotationDao().countAll());
  ps.println("Institutions: "+ daoFactory.getInstitutionDao().countAll());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Retrieves the annotations from an AnnotatedObject, initializing them if necessary.
 *
 * @param ao The annotated object instance with possibly non-initialized annotations
 * @return The returned annotations are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<Annotation> ensureInitializedAnnotations(AnnotatedObject ao) {
  Collection<Annotation> annotations;
  if (IntactCore.isInitialized(ao.getAnnotations())) {
    annotations = ao.getAnnotations();
  } else {
    annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(ao.getClass(), ao.getAc());
  }
  return annotations;
}
origin: uk.ac.ebi.intact.bridges.coredep/intact-cdb

IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation );
  IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().update( annotation );
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().delete( annotation );
origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().update( annot );
containsAnnotation = true;
break;
origin: uk.ac.ebi.intact.core/intact-core-readonly

private Annotation synchronizeAnnotation( Annotation annotation, AnnotatedObject parent ) {
  if (annotation.getAc() != null) {
    return IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
        .getAnnotationDao().getByAc(annotation.getAc());
  }
  else {
  }
  annotation.setCvTopic( synchronize( annotation.getCvTopic() ) );
  if (annotation.getAc() == null && parent.getAc() != null) {
    annotatedObjectsToPersist.put(keyBuilder.keyForAnnotation(annotation, parent), annotation);
  }
  return annotation;
}
origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

@Transactional(propagation = Propagation.REQUIRES_NEW)
/**
 * Hide all the given cvs with the given message
 */
public void hideTerms(Collection<CvObject> cvs, String message){
  DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory();
  AnnotationDao annDao = factory.getAnnotationDao();
  for (CvObject cv : cvs){
    cv = factory.getEntityManager().merge(cv);
    boolean hasHidden = false;
    for (Annotation annotation : cv.getAnnotations()){
      if (annotation.getCvTopic() != null && CvTopic.HIDDEN.equalsIgnoreCase(annotation.getCvTopic().getShortLabel())){
        hasHidden = true;
      }
    }
    if (!hasHidden){
      annDao.persist(CvUpdateUtils.hideTerm(cv, message));
    }
  }
}
origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

annotationDao.update(updated);
annotationDao.persist(created);
annotationDao.delete(deleted);
origin: uk.ac.ebi.intact.core/intact-core

private Annotation synchronizeAnnotation( Annotation annotation, AnnotatedObject parent ) {
  if (annotation.getAc() != null) {
    return IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
        .getAnnotationDao().getByAc(annotation.getAc());
  }
  else {
  }
  annotation.setCvTopic( synchronize( annotation.getCvTopic() ) );
  if (annotation.getAc() == null && parent.getAc() != null) {
    annotatedObjectsToPersist.put(keyBuilder.keyForAnnotation(annotation, parent), annotation);
  }
  return annotation;
}
origin: uk.ac.ebi.intact.bridges.coredep/intact-cdb

if ( ! experiment.getAnnotations().contains( annotation ) ) {
  IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation );
  experiment.addAnnotation( annotation );
  IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getExperimentDao().update( experiment );
origin: uk.ac.ebi.intact.dbupdate/protein-mapping

log.info("annotation no_uniprot_update removed from the annotations of " + accession);
prot.removeAnnotation(a);
daoFactory.getAnnotationDao().delete(a);
log.info("caution removed from the annotations of " + accession);
prot.removeAnnotation(a2);
daoFactory.getAnnotationDao().delete(a2);
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Retrieves the annotations from an AnnotatedObject, initializing them if necessary.
 *
 * @param ao The annotated object instance with possibly non-initialized annotations
 * @return The returned annotations are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<Annotation> ensureInitializedAnnotations(AnnotatedObject ao) {
  Collection<Annotation> annotations;
  if (IntactCore.isInitialized(ao.getAnnotations())) {
    annotations = ao.getAnnotations();
  } else {
    annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(ao.getClass(), ao.getAc());
  }
  return annotations;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Prints the most counts in the database.
 * @param ps The printStream to use
 *
 * @since 1.9.0
 */
public static void printDatabaseCounts(PrintStream ps) {
  final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory();
  ps.println("Publications: "+ daoFactory.getPublicationDao().countAll());
  ps.println("\tXrefs: "+ daoFactory.getXrefDao(PublicationXref.class).countAll());
  ps.println("\tAliases: "+ daoFactory.getAliasDao(PublicationAlias.class).countAll());
  ps.println("Experiments: "+ daoFactory.getExperimentDao().countAll());
  ps.println("\tXrefs: "+ daoFactory.getXrefDao(ExperimentXref.class).countAll());
  ps.println("\tAliases: "+ daoFactory.getAliasDao(ExperimentAlias.class).countAll());
  ps.println("Interactors: "+ daoFactory.getInteractorDao().countAll());
  ps.println("\tInteractions: "+ daoFactory.getInteractionDao().countAll());
  ps.println("\tPolymers: " + daoFactory.getPolymerDao().countAll());
  ps.println("\t\tProteins: "+ daoFactory.getProteinDao().countAll());
  ps.println("\t\tNucleic Acids: "+ daoFactory.getInteractorDao(NucleicAcidImpl.class).countAll());
  ps.println("\tSmall molecules: " + daoFactory.getInteractorDao(SmallMoleculeImpl.class).countAll());
  ps.println("\tInteractor Xrefs: "+ daoFactory.getXrefDao(InteractorXref.class).countAll());
  ps.println("\tInteractor Aliases: "+ daoFactory.getAliasDao(InteractorAlias.class).countAll());
  ps.println("Components: "+ daoFactory.getComponentDao().countAll());
  ps.println("Features: "+ daoFactory.getFeatureDao().countAll());
  ps.println("\tRanges: "+ daoFactory.getRangeDao().countAll());
  ps.println("CvObjects: "+ daoFactory.getCvObjectDao().countAll());
  ps.println("BioSources: "+ daoFactory.getBioSourceDao().countAll());
  ps.println("Annotations: "+ daoFactory.getAnnotationDao().countAll());
  ps.println("Institutions: "+ daoFactory.getInstitutionDao().countAll());
}
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-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;
}
uk.ac.ebi.intact.core.persistence.daoAnnotationDao

Most used methods

  • delete
  • update
  • countAll
  • getByAc
  • getByParentAc
    Fetches the annotations using its parent AC.
  • persist

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • setScale (BigDecimal)
  • runOnUiThread (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Menu (java.awt)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JFrame (javax.swing)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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