Class CompositeSequenceDaoImpl
- 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<CompositeSequence,CompositeSequenceValueObject>
-
- ubic.gemma.persistence.service.expression.designElement.CompositeSequenceDaoImpl
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,BaseDao<CompositeSequence>
,BaseVoEnabledDao<CompositeSequence,CompositeSequenceValueObject>
,CachedFilteringDao<CompositeSequence>
,CachedFilteringVoEnabledDao<CompositeSequence,CompositeSequenceValueObject>
,CompositeSequenceDao
,FilteringDao<CompositeSequence>
,FilteringVoEnabledDao<CompositeSequence,CompositeSequenceValueObject>
@Repository public class CompositeSequenceDaoImpl extends AbstractQueryFilteringVoEnabledDao<CompositeSequence,CompositeSequenceValueObject> implements CompositeSequenceDao
- Author:
- pavlidis
-
-
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
log
-
Fields inherited from interface ubic.gemma.persistence.service.expression.designElement.CompositeSequenceDao
OBJECT_ALIAS
-
-
Constructor Summary
Constructors Constructor Description CompositeSequenceDaoImpl(SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CompositeSequenceValueObject
doLoadValueObject(CompositeSequence entity)
Load a value object for a given entity.CompositeSequence
find(CompositeSequence compositeSequence)
Does a look up for the given entity in the persistent storage, usually looking for a specific identifier ( either id or a string property).Collection<CompositeSequence>
findByBioSequence(BioSequence bioSequence)
Collection<CompositeSequence>
findByBioSequenceName(String name)
Collection<CompositeSequence>
findByGene(Gene gene)
Slice<CompositeSequence>
findByGene(Gene gene, int start, int limit)
Collection<CompositeSequence>
findByGene(Gene gene, ArrayDesign arrayDesign)
Collection<CompositeSequence>
findByName(String name)
CompositeSequence
findByName(ArrayDesign arrayDesign, String name)
protected Query
getFilteringCountQuery(Filters filters)
Produce a query that will be used to retrieve the size ofAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)
.protected Query
getFilteringIdQuery(Filters filters, Sort sort)
Produce a query that will be used to retrieve IDs 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.Map<CompositeSequence,Collection<Gene>>
getGenes(Collection<CompositeSequence> compositeSequences)
Given a collection of composite sequences returns a map of the given composite sequences to a collection of genesSlice<Gene>
getGenes(CompositeSequence compositeSequence, int offset, int limit)
given a composite sequence returns a collection of genesMap<CompositeSequence,Collection<BioSequence2GeneProduct>>
getGenesWithSpecificity(Collection<CompositeSequence> compositeSequences)
Collection<Object[]>
getRawSummary(Collection<CompositeSequence> compositeSequences)
Collection<Object[]>
getRawSummary(ArrayDesign arrayDesign, int numResults)
protected void
initializeCachedFilteringResult(CompositeSequence cachedEntity)
Initialize a result fromAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)
retrieved from the HibernateStandardQueryCache
.void
thaw(Collection<CompositeSequence> compositeSequences)
void
thaw(CompositeSequence cs)
-
Methods inherited from class ubic.gemma.persistence.service.AbstractQueryFilteringVoEnabledDao
count, countWithCache, getEntityTransformer, getValueObjectTransformer, load, load, loadIds, loadIdsWithCache, loadValueObjects, loadValueObjects, loadValueObjectsWithCache, loadValueObjectsWithCache, loadWithCache, loadWithCache
-
Methods inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
afterPropertiesSet, configureFilterableProperties, 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, create, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, getBatchSize, getElementClass, getIdentifierPropertyName, getSessionFactory, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, streamQuery, 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, create, findOrCreate, getElementClass, getIdentifierPropertyName, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, 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
-
CompositeSequenceDaoImpl
@Autowired public CompositeSequenceDaoImpl(SessionFactory sessionFactory)
-
-
Method Detail
-
doLoadValueObject
protected CompositeSequenceValueObject doLoadValueObject(CompositeSequence 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<CompositeSequence,CompositeSequenceValueObject>
-
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<CompositeSequence,CompositeSequenceValueObject>
- Returns:
- a
Query
that produce a list ofAbstractQueryFilteringVoEnabledDao
-
initializeCachedFilteringResult
protected void initializeCachedFilteringResult(CompositeSequence 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<CompositeSequence,CompositeSequenceValueObject>
-
getFilteringIdQuery
protected Query getFilteringIdQuery(@Nullable Filters filters, @Nullable Sort sort)
Description copied from class:AbstractQueryFilteringVoEnabledDao
Produce a query that will be used to retrieve IDs ofAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)
.- Overrides:
getFilteringIdQuery
in classAbstractQueryFilteringVoEnabledDao<CompositeSequence,CompositeSequenceValueObject>
-
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<CompositeSequence,CompositeSequenceValueObject>
- Returns:
- a
Query
which must return a singleLong
value
-
findByBioSequence
public Collection<CompositeSequence> findByBioSequence(BioSequence bioSequence)
- Specified by:
findByBioSequence
in interfaceCompositeSequenceDao
-
findByBioSequenceName
public Collection<CompositeSequence> findByBioSequenceName(String name)
- Specified by:
findByBioSequenceName
in interfaceCompositeSequenceDao
-
findByGene
public Collection<CompositeSequence> findByGene(Gene gene)
- Specified by:
findByGene
in interfaceCompositeSequenceDao
-
findByGene
public Slice<CompositeSequence> findByGene(Gene gene, int start, int limit)
- Specified by:
findByGene
in interfaceCompositeSequenceDao
-
findByGene
public Collection<CompositeSequence> findByGene(Gene gene, ArrayDesign arrayDesign)
- Specified by:
findByGene
in interfaceCompositeSequenceDao
-
findByName
public Collection<CompositeSequence> findByName(String name)
- Specified by:
findByName
in interfaceCompositeSequenceDao
-
findByName
public CompositeSequence findByName(ArrayDesign arrayDesign, String name)
- Specified by:
findByName
in interfaceCompositeSequenceDao
-
getGenes
public Map<CompositeSequence,Collection<Gene>> getGenes(Collection<CompositeSequence> compositeSequences)
Description copied from interface:CompositeSequenceDao
Given a collection of composite sequences returns a map of the given composite sequences to a collection of genes- Specified by:
getGenes
in interfaceCompositeSequenceDao
- Parameters:
compositeSequences
- composite sequences- Returns:
- map
-
getGenes
public Slice<Gene> getGenes(CompositeSequence compositeSequence, int offset, int limit)
Description copied from interface:CompositeSequenceDao
given a composite sequence returns a collection of genes- Specified by:
getGenes
in interfaceCompositeSequenceDao
- Parameters:
compositeSequence
- sequenceoffset
- offsetlimit
- limit- Returns:
- collection of genes
-
getGenesWithSpecificity
public Map<CompositeSequence,Collection<BioSequence2GeneProduct>> getGenesWithSpecificity(Collection<CompositeSequence> compositeSequences)
- Specified by:
getGenesWithSpecificity
in interfaceCompositeSequenceDao
- Parameters:
compositeSequences
- sequences- Returns:
- a map of CompositeSequences to BlatAssociations.
-
getRawSummary
public Collection<Object[]> getRawSummary(@Nullable Collection<CompositeSequence> compositeSequences)
- Specified by:
getRawSummary
in interfaceCompositeSequenceDao
-
getRawSummary
public Collection<Object[]> getRawSummary(ArrayDesign arrayDesign, int numResults)
- Specified by:
getRawSummary
in interfaceCompositeSequenceDao
-
thaw
public void thaw(Collection<CompositeSequence> compositeSequences)
- Specified by:
thaw
in interfaceCompositeSequenceDao
-
thaw
public void thaw(CompositeSequence cs)
- Specified by:
thaw
in interfaceCompositeSequenceDao
-
find
public CompositeSequence find(CompositeSequence compositeSequence)
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).- Specified by:
find
in interfaceBaseDao<CompositeSequence>
- Overrides:
find
in classAbstractDao<CompositeSequence>
- Parameters:
compositeSequence
- the entity to look for.- Returns:
- an entity that was found in the persistent storage, or null if no such entity was found.
-
-