public class

AnnotationPersistenceServiceImpl

extends QueryableImpl
implements AnnotationPersistenceService
java.lang.Object
   ↳ org.mbari.sql.QueryableImpl
     ↳ vars.annotation.AnnotationPersistenceServiceImpl

Class Overview

All methods in this class are thread safe. They are backed by threadLocal EntityManagers OR by a single use JDBC connection.

Summary

[Expand]
Inherited Fields
From class org.mbari.sql.QueryableImpl
Public Constructors
AnnotationPersistenceServiceImpl(AnnotationDAOFactory annotationDAOFactory, EntityManagerFactory kbEntityManagerFactory, PersistenceCache persistenceCache)
Constructs ...
Public Methods
List<String> findAllPlatformNames()
Find all platforms that were used in the annotations database.
Collection<String> findAllReferenceNumbers(VideoArchiveSet videoArchiveSet, Concept concept)
Looks up the 'identity-reference' values for a given concept within a VideoArchiveSet These are used to tag an annotation as the same creature that's been seen before.
List<String> findAllVideoArchiveNames()
Concept findConceptByName(String name)
Yes this duplicates functionality in ConceptDAO.
List<String> findDescendantNamesFor(Concept concept)
Find Descendant Names as a sorted List of Strings
Date findEarliestAnnotationDate()
Find the recorded date (from VideoFrame) of the earliest annotation made in the VARS database
Date findLatestAnnotationDate()
Find the recorded date (from VideoFrame) of the latest annotation made in the VARS database
Collection<LinkTemplate> findLinkTemplatesFor(Concept concept)
Concept findRootConcept()
Fetches the root concept from the database.
ConceptDAO getReadOnlyConceptDAO()
Retrieve the underlying ConceptDAO used.
void updateConceptNameUsedByAnnotations(Concept concept)
Updates all Observations, Associations, and LinkTemplates in the database so that any that use a non-primary name for the given concept are changed so that they use the primary name.
[Expand]
Inherited Methods
From class org.mbari.sql.QueryableImpl
From class java.lang.Object
From interface org.mbari.sql.IQueryable
From interface vars.annotation.AnnotationPersistenceService

Public Constructors

public AnnotationPersistenceServiceImpl (AnnotationDAOFactory annotationDAOFactory, EntityManagerFactory kbEntityManagerFactory, PersistenceCache persistenceCache)

Constructs ...

Public Methods

public List<String> findAllPlatformNames ()

Find all platforms that were used in the annotations database.

Returns
  • A List of each distinct platform found in the VideoArchiveSet table.

public Collection<String> findAllReferenceNumbers (VideoArchiveSet videoArchiveSet, Concept concept)

Looks up the 'identity-reference' values for a given concept within a VideoArchiveSet These are used to tag an annotation as the same creature that's been seen before.

public List<String> findAllVideoArchiveNames ()

public Concept findConceptByName (String name)

Yes this duplicates functionality in ConceptDAO. But this version keeps a transaction open so that the L1 cache never gets cleared. This greatly speeds up lookups!!

public List<String> findDescendantNamesFor (Concept concept)

Find Descendant Names as a sorted List of Strings

public Date findEarliestAnnotationDate ()

Find the recorded date (from VideoFrame) of the earliest annotation made in the VARS database

Returns
  • The date of the earliest annotation

public Date findLatestAnnotationDate ()

Find the recorded date (from VideoFrame) of the latest annotation made in the VARS database

Returns
  • The date of the latest annotation

public Collection<LinkTemplate> findLinkTemplatesFor (Concept concept)

public Concept findRootConcept ()

Fetches the root concept from the database. Also fetches the children and grandchildren of the root concept.

public ConceptDAO getReadOnlyConceptDAO ()

Retrieve the underlying ConceptDAO used.

public void updateConceptNameUsedByAnnotations (Concept concept)

Updates all Observations, Associations, and LinkTemplates in the database so that any that use a non-primary name for the given concept are changed so that they use the primary name.