Class TaxonDaoImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractDao<O>
-
- ubic.gemma.persistence.service.AbstractVoEnabledDao<O,VO>
-
- ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao<O,VO>
-
- ubic.gemma.persistence.service.AbstractQueryFilteringVoEnabledDao<Taxon,TaxonValueObject>
-
- ubic.gemma.persistence.service.genome.taxon.TaxonDaoImpl
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,BaseDao<Taxon>
,BaseVoEnabledDao<Taxon,TaxonValueObject>
,CachedFilteringDao<Taxon>
,CachedFilteringVoEnabledDao<Taxon,TaxonValueObject>
,FilteringDao<Taxon>
,FilteringVoEnabledDao<Taxon,TaxonValueObject>
,TaxonDao
@Repository public class TaxonDaoImpl extends AbstractQueryFilteringVoEnabledDao<Taxon,TaxonValueObject> implements TaxonDao
- Author:
- pavlidis
- See Also:
Taxon
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer, AbstractFilteringVoEnabledDao.FilterablePropertyMeta
-
-
Field Summary
-
Fields inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDao
REPORT_SLOW_QUERY_AFTER_MS
-
Fields inherited from class ubic.gemma.persistence.service.AbstractDao
elementClass, log
-
Fields inherited from interface ubic.gemma.persistence.service.genome.taxon.TaxonDao
OBJECT_ALIAS
-
-
Constructor Summary
Constructors Constructor Description TaxonDaoImpl(SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureFilterableProperties(AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer configurer)
Register filterable properties.Taxon
create(Taxon taxon)
Create an object.protected TaxonValueObject
doLoadValueObject(Taxon entity)
Load a value object for a given entity.Taxon
find(Taxon taxon)
Does a look up for the given entity in the persistent storage, usually looking for a specific identifier ( either id or a string property).Taxon
findByCommonName(String commonName)
Taxon
findByNcbiId(Integer ncbiId)
Taxon
findByScientificName(String scientificName)
Searches for a taxon by its scientific name, case insensitive.Collection<Taxon>
findTaxonUsedInEvidence()
protected Query
getFilteringCountQuery(Filters filters)
Produce a query that will be used to retrieve the size ofAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)
.protected Query
getFilteringQuery(Filters filters, Sort sort)
Produce a query for retrieving value objects after applying a set of filters and a given ordering.protected void
initializeCachedFilteringResult(Taxon cachedEntity)
Initialize a result fromAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)
retrieved from the HibernateStandardQueryCache
.-
Methods inherited from class ubic.gemma.persistence.service.AbstractQueryFilteringVoEnabledDao
count, countWithCache, getEntityTransformer, getFilteringIdQuery, getValueObjectTransformer, load, load, loadIds, loadIdsWithCache, loadValueObjects, loadValueObjects, loadValueObjectsWithCache, loadValueObjectsWithCache, loadWithCache, loadWithCache
-
Methods inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
afterPropertiesSet, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyMeta, getFilterablePropertyMeta, getFilterablePropertyType, getSort
-
Methods inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDao
doLoadValueObjects, loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds, postProcessValueObjects
-
Methods inherited from class ubic.gemma.persistence.service.AbstractDao
countAll, create, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, getBatchSize, getElementClass, getIdentifierPropertyName, getSessionFactory, load, load, loadAll, loadReference, loadReference, remove, remove, remove, save, save, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.persistence.service.BaseDao
countAll, create, findOrCreate, getElementClass, getIdentifierPropertyName, load, load, loadAll, loadReference, loadReference, remove, remove, remove, save, save, update, update
-
Methods inherited from interface ubic.gemma.persistence.service.BaseVoEnabledDao
loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds
-
Methods inherited from interface ubic.gemma.persistence.service.FilteringDao
count, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyType, getSort, load, load, loadIds
-
Methods inherited from interface ubic.gemma.persistence.service.FilteringVoEnabledDao
loadValueObjects, loadValueObjects
-
-
-
-
Constructor Detail
-
TaxonDaoImpl
@Autowired public TaxonDaoImpl(SessionFactory sessionFactory)
-
-
Method Detail
-
create
public Taxon create(Taxon taxon)
Description copied from interface:BaseDao
Create an object. If the entity type is immutable, this may also remove any existing entities identified by an appropriate 'find' method.
-
find
public Taxon find(Taxon taxon)
Description copied from interface:BaseDao
Does a look up for the given entity in the persistent storage, usually looking for a specific identifier ( either id or a string property).
-
findByCommonName
public Taxon findByCommonName(String commonName)
- Specified by:
findByCommonName
in interfaceTaxonDao
-
findByScientificName
public Taxon findByScientificName(String scientificName)
Description copied from interface:TaxonDao
Searches for a taxon by its scientific name, case insensitive.- Specified by:
findByScientificName
in interfaceTaxonDao
- Parameters:
scientificName
- the scientific name to be matched- Returns:
- a Taxon whose scientific name matches the given string.
-
findTaxonUsedInEvidence
public Collection<Taxon> findTaxonUsedInEvidence()
- Specified by:
findTaxonUsedInEvidence
in interfaceTaxonDao
-
findByNcbiId
public Taxon findByNcbiId(Integer ncbiId)
- Specified by:
findByNcbiId
in interfaceTaxonDao
-
doLoadValueObject
protected TaxonValueObject doLoadValueObject(Taxon entity)
Description copied from class:AbstractVoEnabledDao
Load a value object for a given entity.This should be fast and efficient, and avoid any database query or post-processing. If you need to perform additional queries, implement
AbstractVoEnabledDao.postProcessValueObjects(List)
instead.- Specified by:
doLoadValueObject
in classAbstractVoEnabledDao<Taxon,TaxonValueObject>
-
configureFilterableProperties
protected void configureFilterableProperties(AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer configurer)
Description copied from class:AbstractFilteringVoEnabledDao
Register filterable properties.- Overrides:
configureFilterableProperties
in classAbstractFilteringVoEnabledDao<Taxon,TaxonValueObject>
-
getFilteringQuery
protected Query getFilteringQuery(@Nullable Filters filters, @Nullable Sort sort)
Description copied from class:AbstractQueryFilteringVoEnabledDao
Produce a query for retrieving value objects after applying a set of filters and a given ordering.Note that if your implementation does not produce a
List
ofAbstractQueryFilteringVoEnabledDao
whenQuery.list()
is invoked, you must overrideAbstractQueryFilteringVoEnabledDao.getValueObjectTransformer()
.The make the cached query (i.e.
AbstractQueryFilteringVoEnabledDao.loadWithCache(Filters, Sort)
behave the same, you also have to explicitly initialize any lazy relations inAbstractVoEnabledDao.doLoadValueObject(Identifiable)
because the VO constructor will not initialize them.- Specified by:
getFilteringQuery
in classAbstractQueryFilteringVoEnabledDao<Taxon,TaxonValueObject>
- Returns:
- a
Query
that produce a list ofAbstractQueryFilteringVoEnabledDao
-
initializeCachedFilteringResult
protected void initializeCachedFilteringResult(Taxon cachedEntity)
Description copied from class:AbstractQueryFilteringVoEnabledDao
Initialize a result fromAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)
retrieved from the HibernateStandardQueryCache
.Lazy-loaded relations that are fetched in
AbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)
must be initialized manually in this method to ensure that the entity has all the expected fields if they are retrieved from the second-level cache.- Specified by:
initializeCachedFilteringResult
in classAbstractQueryFilteringVoEnabledDao<Taxon,TaxonValueObject>
-
getFilteringCountQuery
protected Query getFilteringCountQuery(@Nullable Filters filters)
Description copied from class:AbstractQueryFilteringVoEnabledDao
Produce a query that will be used to retrieve the size ofAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)
.- Overrides:
getFilteringCountQuery
in classAbstractQueryFilteringVoEnabledDao<Taxon,TaxonValueObject>
- Returns:
- a
Query
which must return a singleLong
value
-
-