public class

QueryPersistenceServiceImpl

extends Object
implements QueryPersistenceService
java.lang.Object
   ↳ vars.query.QueryPersistenceServiceImpl

Class Overview

DAO for use by the query app. This drops out of hibernate and uses a lot of SQL internally for speed reasons.

Summary

Public Constructors
QueryPersistenceServiceImpl()
Constructs ...
Public Methods
QueryResults executeQuery(String query)
<T> T executeQueryFunction(String query, QueryFunction<T> queryFunction)
List<String> findAllConceptNamesAsStrings()
Collection<ILink> findAllLinkTemplates()
Similar to findByConceptNames.
Collection<String> findAllNamesUsedInAnnotations()
Retrives all conceptnames actually used in annotations.
Collection<ILink> findByConceptNames(Collection<String> conceptNames)
Looks up all associations in a database that were used with Observations containing the specified conceptNames
QueryableImpl getAnnotationQueryable()
Integer getCountOfUniqueValuesByColumn(String columnName)
Returns the count of unique columns found in the table for a given column
Map<String, String> getMetaData()
Retrieves the metadata for the Annotation table.
String getURL()
Collection<?> getUniqueValuesByColumn(String columnName)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mbari.sql.IQueryable
From interface vars.query.QueryPersistenceService

Public Constructors

public QueryPersistenceServiceImpl ()

Constructs ...

Public Methods

public QueryResults executeQuery (String query)

Throws
Exception

public T executeQueryFunction (String query, QueryFunction<T> queryFunction)

public List<String> findAllConceptNamesAsStrings ()

public Collection<ILink> findAllLinkTemplates ()

Similar to findByConceptNames. However, this looksup all LinkTemplates rather that Associations.

Returns
  • A Collection of AssociationBeans

public Collection<String> findAllNamesUsedInAnnotations ()

Retrives all conceptnames actually used in annotations. This query searches the Observation.conceptName, Association.toConcept, and ConceptName.name fields fields

Returns
  • A Collection of all ConceptNames that were actually used in Annotations as well as all conceptNames defined in the knowledgebase

public Collection<ILink> findByConceptNames (Collection<String> conceptNames)

Looks up all associations in a database that were used with Observations containing the specified conceptNames

Parameters
conceptNames A collection of Strings representing the conceptnames to lookup
Returns
  • A collection of AssociationBeans representing the associations actually used to annotate Observations with the specifed conceptNames.

public QueryableImpl getAnnotationQueryable ()

public Integer getCountOfUniqueValuesByColumn (String columnName)

Returns the count of unique columns found in the table for a given column

public Map<String, String> getMetaData ()

Retrieves the metadata for the Annotation table. Returns are in alphabetical order.

Returns
  • A Map where key is the columns name as a String, value is the columns Object type as a String (e.g. "java.lang.String". (This would be the type returned by resultSet.getObject())

public String getURL ()

public Collection<?> getUniqueValuesByColumn (String columnName)