Class GeneDaoImpl
- 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<Gene,GeneValueObject>
-
- ubic.gemma.persistence.service.genome.GeneDaoImpl
-
- All Implemented Interfaces:
InitializingBean,BaseDao<Gene>,BaseVoEnabledDao<Gene,GeneValueObject>,CachedFilteringDao<Gene>,CachedFilteringVoEnabledDao<Gene,GeneValueObject>,FilteringDao<Gene>,FilteringVoEnabledDao<Gene,GeneValueObject>,GeneDao
@Repository public class GeneDaoImpl extends AbstractQueryFilteringVoEnabledDao<Gene,GeneValueObject> implements GeneDao, InitializingBean
Base Spring DAO Class: is able to create, update, remove, load, and find objects of typeGene.- See Also:
Gene
-
-
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.GeneDao
OBJECT_ALIAS
-
-
Constructor Summary
Constructors Constructor Description GeneDaoImpl(SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GeneValueObjectdoLoadValueObject(Gene entity)Load a value object for a given entity.Genefind(Gene gene)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<Gene>find(PhysicalLocation physicalLocation)Find all genes at a physical location.GenefindByAccession(String accession, ExternalDatabase source)Collection<Gene>findByAlias(String search)Gets all the genes referred to by the alias defined by the search string.GenefindByEnsemblId(String id)GenefindByNcbiId(Integer ncbiId)Map<Integer,Gene>findByNcbiIds(Collection<Integer> ncbiIds)Quickly load exact matches.Collection<Gene>findByOfficialName(String officialName)Collection<Gene>findByOfficialNameInexact(String officialName)Collection<Gene>findByOfficialSymbol(String officialSymbol)GenefindByOfficialSymbol(String symbol, Taxon taxon)Collection<Gene>findByOfficialSymbolInexact(String officialSymbol)Map<String,Gene>findByOfficialSymbols(Collection<String> query, Long taxonId)Quickly load exact matches.Collection<Gene>findByPhysicalLocation(PhysicalLocation location)longgetCompositeSequenceCountById(long id)Gets a count of the CompositeSequences related to the gene identified by the given id.Collection<CompositeSequence>getCompositeSequences(Gene gene, ArrayDesign arrayDesign)Collection<CompositeSequence>getCompositeSequencesById(long id)Gets all the CompositeSequences related to the gene identified by the given id.protected QuerygetFilteringCountQuery(Filters filters)Produce a query that will be used to retrieve the size ofAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort).protected QuerygetFilteringQuery(Filters filters, Sort sort)Produce a query for retrieving value objects after applying a set of filters and a given ordering.Collection<Gene>getMicroRnaByTaxon(Taxon taxon)intgetPlatformCountById(Long id)protected voidinitializeCachedFilteringResult(Gene entity)Initialize a result fromAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort)retrieved from the HibernateStandardQueryCache.Collection<Gene>loadKnownGenes(Taxon taxon)List<Gene>loadThawed(Collection<Long> ids)Collection<Gene>loadThawedLiter(Collection<Long> ids)protected voidpostProcessValueObjects(List<GeneValueObject> geneValueObjects)Post-process VOs in bulk.voidremove(Gene gene)Remove a persistent instanceintremoveAll()Genethaw(Gene gene)GenethawAliases(Gene gene)Only thaw the Aliases, very light versionCollection<Gene>thawLite(Collection<Gene> genes)GenethawLite(Gene gene)GenethawLiter(Gene gene)-
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, 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
-
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, 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, create, findOrCreate, getElementClass, getIdentifierPropertyName, load, load, loadAll, loadReference, loadReference, 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
-
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
-
-
-
-
Constructor Detail
-
GeneDaoImpl
@Autowired public GeneDaoImpl(SessionFactory sessionFactory)
-
-
Method Detail
-
find
public Collection<Gene> find(PhysicalLocation physicalLocation)
Description copied from interface:GeneDaoFind all genes at a physical location. All overlapping genes are returned. The location can be a point or a region. If strand is non-null, only genes on the same strand are returned.
-
findByAccession
public Gene findByAccession(String accession, @Nullable ExternalDatabase source)
- Specified by:
findByAccessionin interfaceGeneDao
-
findByAlias
public Collection<Gene> findByAlias(String search)
Gets all the genes referred to by the alias defined by the search string.- Specified by:
findByAliasin interfaceGeneDao- Parameters:
search- search string- Returns:
- Collection
-
findByEnsemblId
public Gene findByEnsemblId(String id)
- Specified by:
findByEnsemblIdin interfaceGeneDao
-
findByNcbiId
public Gene findByNcbiId(Integer ncbiId)
- Specified by:
findByNcbiIdin interfaceGeneDao
-
findByOfficialSymbol
public Collection<Gene> findByOfficialSymbol(String officialSymbol)
- Specified by:
findByOfficialSymbolin interfaceGeneDao
-
findByOfficialName
public Collection<Gene> findByOfficialName(String officialName)
- Specified by:
findByOfficialNamein interfaceGeneDao
-
findByOfficialNameInexact
public Collection<Gene> findByOfficialNameInexact(String officialName)
- Specified by:
findByOfficialNameInexactin interfaceGeneDao
-
findByOfficialSymbol
public Gene findByOfficialSymbol(String symbol, Taxon taxon)
- Specified by:
findByOfficialSymbolin interfaceGeneDao
-
findByOfficialSymbolInexact
public Collection<Gene> findByOfficialSymbolInexact(String officialSymbol)
- Specified by:
findByOfficialSymbolInexactin interfaceGeneDao
-
findByOfficialSymbols
public Map<String,Gene> findByOfficialSymbols(Collection<String> query, Long taxonId)
Description copied from interface:GeneDaoQuickly load exact matches.- Specified by:
findByOfficialSymbolsin interfaceGeneDao- Parameters:
query- querytaxonId- taxon id- Returns:
- map of gene symbol (toLowerCase()) to the gene. The actual query that led to the gene is not retained.
-
findByNcbiIds
public Map<Integer,Gene> findByNcbiIds(Collection<Integer> ncbiIds)
Description copied from interface:GeneDaoQuickly load exact matches.- Specified by:
findByNcbiIdsin interfaceGeneDao- Parameters:
ncbiIds- ncbi ids- Returns:
- map of NCBI Id to the gene.
-
findByPhysicalLocation
public Collection<Gene> findByPhysicalLocation(PhysicalLocation location)
- Specified by:
findByPhysicalLocationin interfaceGeneDao
-
getCompositeSequenceCountById
public long getCompositeSequenceCountById(long id)
Gets a count of the CompositeSequences related to the gene identified by the given id.- Specified by:
getCompositeSequenceCountByIdin interfaceGeneDao- Parameters:
id- id- Returns:
- Collection
-
getCompositeSequences
public Collection<CompositeSequence> getCompositeSequences(Gene gene, ArrayDesign arrayDesign)
- Specified by:
getCompositeSequencesin interfaceGeneDao
-
getCompositeSequencesById
public Collection<CompositeSequence> getCompositeSequencesById(long id)
Gets all the CompositeSequences related to the gene identified by the given id.- Specified by:
getCompositeSequencesByIdin interfaceGeneDao- Returns:
- Collection
-
getMicroRnaByTaxon
public Collection<Gene> getMicroRnaByTaxon(Taxon taxon)
- Specified by:
getMicroRnaByTaxonin interfaceGeneDao- Parameters:
taxon- taxon- Returns:
- a collection of genes that are actually MicroRNA for a given taxon
-
getPlatformCountById
public int getPlatformCountById(Long id)
- Specified by:
getPlatformCountByIdin interfaceGeneDao- Parameters:
id- id- Returns:
- how many platforms have a representation of this gene
-
loadKnownGenes
public Collection<Gene> loadKnownGenes(Taxon taxon)
- Specified by:
loadKnownGenesin interfaceGeneDao- Parameters:
taxon- taxon- Returns:
- a collection of genes for the specified taxon (not all genes, ie not probe aligned regions and predicted genes)
-
loadThawed
public List<Gene> loadThawed(Collection<Long> ids)
- Specified by:
loadThawedin interfaceGeneDao
-
loadThawedLiter
public Collection<Gene> loadThawedLiter(Collection<Long> ids)
- Specified by:
loadThawedLiterin interfaceGeneDao
-
thawAliases
public Gene thawAliases(Gene gene)
Only thaw the Aliases, very light version- Specified by:
thawAliasesin interfaceGeneDao
-
thawLite
public Collection<Gene> thawLite(Collection<Gene> genes)
-
remove
public void remove(Gene gene)
Description copied from interface:BaseDaoRemove a persistent instance
-
find
public Gene find(Gene gene)
Description copied from interface:BaseDaoDoes a look up for the given entity in the persistent storage, usually looking for a specific identifier ( either id or a string property).
-
doLoadValueObject
protected GeneValueObject doLoadValueObject(Gene entity)
Description copied from class:AbstractVoEnabledDaoLoad 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:
doLoadValueObjectin classAbstractVoEnabledDao<Gene,GeneValueObject>
-
getFilteringQuery
protected Query getFilteringQuery(@Nullable Filters filters, @Nullable Sort sort)
Description copied from class:AbstractQueryFilteringVoEnabledDaoProduce 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
ListofAbstractQueryFilteringVoEnabledDaowhenQuery.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:
getFilteringQueryin classAbstractQueryFilteringVoEnabledDao<Gene,GeneValueObject>- Parameters:
filters- seeFilterQueryUtils.formRestrictionClause(Filters)filters argument for description.- Returns:
- a Hibernated Query object ready to be used for TaxonVO retrieval.
-
initializeCachedFilteringResult
protected void initializeCachedFilteringResult(Gene entity)
Description copied from class:AbstractQueryFilteringVoEnabledDaoInitialize 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:
initializeCachedFilteringResultin classAbstractQueryFilteringVoEnabledDao<Gene,GeneValueObject>
-
getFilteringCountQuery
protected Query getFilteringCountQuery(@Nullable Filters filters)
Description copied from class:AbstractQueryFilteringVoEnabledDaoProduce a query that will be used to retrieve the size ofAbstractQueryFilteringVoEnabledDao.getFilteringQuery(Filters, Sort).- Overrides:
getFilteringCountQueryin classAbstractQueryFilteringVoEnabledDao<Gene,GeneValueObject>- Returns:
- a
Querywhich must return a singleLongvalue
-
postProcessValueObjects
protected void postProcessValueObjects(List<GeneValueObject> geneValueObjects)
Description copied from class:AbstractVoEnabledDaoPost-process VOs in bulk.Use this as an opportunity to load extra informations that could not be populated in the initial
AbstractVoEnabledDao.doLoadValueObject(Identifiable)orAbstractVoEnabledDao.doLoadValueObjects(Collection)- Overrides:
postProcessValueObjectsin classAbstractVoEnabledDao<Gene,GeneValueObject>
-
-