Class CharacteristicDaoImpl
- java.lang.Object
- 
- ubic.gemma.persistence.service.AbstractDao<O>
- 
- ubic.gemma.persistence.service.AbstractVoEnabledDao<O,VO>
- 
- ubic.gemma.persistence.service.AbstractNoopFilteringVoEnabledDao<Characteristic,CharacteristicValueObject>
- 
- ubic.gemma.persistence.service.common.description.CharacteristicDaoImpl
 
 
 
 
- 
- All Implemented Interfaces:
- BaseDao<Characteristic>,- BaseVoEnabledDao<Characteristic,CharacteristicValueObject>,- BrowsingDao<Characteristic>,- CharacteristicDao,- FilteringDao<Characteristic>,- FilteringVoEnabledDao<Characteristic,CharacteristicValueObject>
 
 @Repository public class CharacteristicDaoImpl extends AbstractNoopFilteringVoEnabledDao<Characteristic,CharacteristicValueObject> implements CharacteristicDao - Author:
- Luke, Paul
- See Also:
- Characteristic
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface ubic.gemma.persistence.service.common.description.CharacteristicDaoCharacteristicDao.CharacteristicUsageFrequency
 
- 
 - 
Field Summary- 
Fields inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDaoREPORT_SLOW_QUERY_AFTER_MS
 - 
Fields inherited from class ubic.gemma.persistence.service.AbstractDaoelementClass, log
 - 
Fields inherited from interface ubic.gemma.persistence.service.common.description.CharacteristicDaoOBJECT_ALIAS
 
- 
 - 
Constructor SummaryConstructors Constructor Description CharacteristicDaoImpl(SessionFactory sessionFactory)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Characteristic>browse(int start, int limit)Browse through the characteristics, excluding GO annotations.List<Characteristic>browse(int start, int limit, String orderField, boolean descending)Browse through the characteristics, excluding GO annotations, with sorting.Map<String,Long>countCharacteristicsByValueUriGroupedByNormalizedValue(Collection<String> uris)Count characteristics matching the provided value URIs.protected CharacteristicValueObjectdoLoadValueObject(Characteristic entity)Load a value object for a given entity.CharacteristicfindBestByUri(String uri)Return the characteristic with the most frequently used non-null value by URI.Collection<? extends Characteristic>findByCategory(String query)Collection<Characteristic>findByUri(String uri)Collection<Characteristic>findByUri(Collection<String> uris)Collection<Characteristic>findByValue(String search)Finds all Characteristics whose value match the given search termMap<String,Characteristic>findCharacteristicsByValueUriOrValueLikeGroupedByNormalizedValue(String value)Find characteristics by value matching the provided LIKE pattern.Map<Class<? extends Identifiable>,Map<String,Set<ExpressionExperiment>>>findExperimentReferencesByUris(Collection<String> uris, Taxon taxon, int limit, boolean rankByLevel)Since proxies are returned, they cannot be collected in aHashSetwhich would otherwise cause their initialization by accessingObject.hashCode().Map<Class<? extends Identifiable>,Map<String,Set<ExpressionExperiment>>>findExperimentsByUris(Collection<String> uris, Taxon taxon, int limit, boolean rankByLevel)This search looks at direct annotations, factor values and biomaterials in that order.Map<Characteristic,Identifiable>getParents(Collection<Characteristic> characteristics, Collection<Class<?>> parentClasses, int maxResults)Obtain the parents (i.e.StringnormalizeByValue(Characteristic characteristic)Normalize a characteristic by value.- 
Methods inherited from class ubic.gemma.persistence.service.AbstractNoopFilteringVoEnabledDaocount, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyType, getSort, load, load, loadIds, loadValueObjects, loadValueObjects
 - 
Methods inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDaodoLoadValueObjects, loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds, postProcessValueObjects
 - 
Methods inherited from class ubic.gemma.persistence.service.AbstractDaocountAll, create, create, find, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface ubic.gemma.persistence.service.BaseDaocountAll, create, create, find, findOrCreate, getElementClass, getIdentifierPropertyName, load, load, loadAll, loadReference, loadReference, remove, remove, remove, save, save, update, update
 - 
Methods inherited from interface ubic.gemma.persistence.service.BaseVoEnabledDaoloadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds
 - 
Methods inherited from interface ubic.gemma.persistence.service.FilteringDaocount, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyType, getSort, load, load, loadIds
 - 
Methods inherited from interface ubic.gemma.persistence.service.FilteringVoEnabledDaoloadValueObjects, loadValueObjects
 
- 
 
- 
- 
- 
Constructor Detail- 
CharacteristicDaoImpl@Autowired public CharacteristicDaoImpl(SessionFactory sessionFactory) 
 
- 
 - 
Method Detail- 
browsepublic List<Characteristic> browse(int start, int limit) Description copied from interface:CharacteristicDaoBrowse through the characteristics, excluding GO annotations.- Specified by:
- browsein interface- BrowsingDao<Characteristic>
- Specified by:
- browsein interface- CharacteristicDao
- Parameters:
- start- How far into the list to start
- limit- Maximum records to retrieve (might be subject to security filtering)
- Returns:
- characteristics
 
 - 
browsepublic List<Characteristic> browse(int start, int limit, String orderField, boolean descending) Description copied from interface:CharacteristicDaoBrowse through the characteristics, excluding GO annotations, with sorting.- Specified by:
- browsein interface- BrowsingDao<Characteristic>
- Specified by:
- browsein interface- CharacteristicDao
- Parameters:
- start- query offset
- limit- maximum amount of entries
- orderField- order field
- descending- order direction
- Returns:
- characteristics
 
 - 
findByCategorypublic Collection<? extends Characteristic> findByCategory(String query) - Specified by:
- findByCategoryin interface- CharacteristicDao
 
 - 
findExperimentsByUrispublic Map<Class<? extends Identifiable>,Map<String,Set<ExpressionExperiment>>> findExperimentsByUris(Collection<String> uris, @Nullable Taxon taxon, int limit, boolean rankByLevel) Description copied from interface:CharacteristicDaoThis search looks at direct annotations, factor values and biomaterials in that order.Resulting EEs are filtered by ACLs. The returned collection of EEs is effectively a Set, but since we cannot use since this should be interchangable withCharacteristicDao.findExperimentReferencesByUris(Collection, Taxon, int, boolean).Ranking results by level guarantees correctness if a limit is used as datasets matched by direct annotation will be considered before those matched by factor values or biomaterials. It is however expensive. - Specified by:
- findExperimentsByUrisin interface- CharacteristicDao
- Parameters:
- uris- collection of URIs used for matching characteristics (via- Characteristic.getValueUri())
- taxon- taxon to restrict EEs to, or null to ignore
- limit- limit how many results to return. Set to -1 for no limit.
- rankByLevel- rank results by level before limiting, has no effect if limit is -1
- Returns:
- map of classes (ExpressionExperiment,FactorValue,BioMaterial) to the matching URI to EEs which have an associated characteristic using the given URI. The class lets us track where the annotation was.
 
 - 
findExperimentReferencesByUrispublic Map<Class<? extends Identifiable>,Map<String,Set<ExpressionExperiment>>> findExperimentReferencesByUris(Collection<String> uris, @Nullable Taxon taxon, int limit, boolean rankByLevel) Since proxies are returned, they cannot be collected in aHashSetwhich would otherwise cause their initialization by accessingObject.hashCode(). Thus we need to create aTreeSetover the EE IDs.- Specified by:
- findExperimentReferencesByUrisin interface- CharacteristicDao
- See Also:
- Session.load(Object, Serializable)
 
 - 
findByUripublic Collection<Characteristic> findByUri(Collection<String> uris) - Specified by:
- findByUriin interface- CharacteristicDao
 
 - 
findByUripublic Collection<Characteristic> findByUri(String uri) - Specified by:
- findByUriin interface- CharacteristicDao
 
 - 
findBestByUripublic Characteristic findBestByUri(String uri) Description copied from interface:CharacteristicDaoReturn the characteristic with the most frequently used non-null value by URI.- Specified by:
- findBestByUriin interface- CharacteristicDao
 
 - 
countCharacteristicsByValueUriGroupedByNormalizedValuepublic Map<String,Long> countCharacteristicsByValueUriGroupedByNormalizedValue(Collection<String> uris) Description copied from interface:CharacteristicDaoCount characteristics matching the provided value URIs.The mapping key is the normalized value of the characteristics as per CharacteristicDao.normalizeByValue(Characteristic).- Specified by:
- countCharacteristicsByValueUriGroupedByNormalizedValuein interface- CharacteristicDao
 
 - 
findCharacteristicsByValueUriOrValueLikeGroupedByNormalizedValuepublic Map<String,Characteristic> findCharacteristicsByValueUriOrValueLikeGroupedByNormalizedValue(String value) Description copied from interface:CharacteristicDaoFind characteristics by value matching the provided LIKE pattern.The mapping key is the normalized value of the characteristics as per CharacteristicDao.normalizeByValue(Characteristic).- Specified by:
- findCharacteristicsByValueUriOrValueLikeGroupedByNormalizedValuein interface- CharacteristicDao
 
 - 
normalizeByValuepublic String normalizeByValue(Characteristic characteristic) Description copied from interface:CharacteristicDaoNormalize a characteristic by value.This is obtained by taking the value URI or value if the former is null and converting it to lowercase. - Specified by:
- normalizeByValuein interface- CharacteristicDao
 
 - 
findByValuepublic Collection<Characteristic> findByValue(String search) Description copied from interface:CharacteristicDaoFinds all Characteristics whose value match the given search term- Specified by:
- findByValuein interface- CharacteristicDao
- Parameters:
- search- search
- Returns:
- characteristics
 
 - 
getParentspublic Map<Characteristic,Identifiable> getParents(Collection<Characteristic> characteristics, @Nullable Collection<Class<?>> parentClasses, int maxResults) Description copied from interface:CharacteristicDaoObtain the parents (i.e. owners) of the given characteristics.If a characteristic lacks a parent, its entry will be missing from the returned map. - Specified by:
- getParentsin interface- CharacteristicDao
 
 - 
doLoadValueObjectprotected CharacteristicValueObject doLoadValueObject(Characteristic 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 class- AbstractVoEnabledDao<Characteristic,CharacteristicValueObject>
 
 
- 
 
-