@Repository public class CharacteristicDaoImpl extends AbstractVoEnabledDao<Characteristic,CharacteristicValueObject> implements CharacteristicDao
Characteristic
CharacteristicDao.CharacteristicUsageFrequency
REPORT_SLOW_QUERY_AFTER_MS
DEFAULT_BATCH_SIZE, elementClass, log
OBJECT_ALIAS
Constructor and Description |
---|
CharacteristicDaoImpl(SessionFactory sessionFactory) |
Modifier and Type | Method and 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 CharacteristicValueObject |
doLoadValueObject(Characteristic entity)
Load a value object for a given entity.
|
Collection<? extends Characteristic> |
findByCategory(String query) |
Collection<Characteristic> |
findByUri(Collection<Class<?>> classes,
Collection<String> characteristicUris) |
Collection<Characteristic> |
findByUri(Collection<String> uris) |
Collection<Characteristic> |
findByUri(String searchString) |
Collection<Characteristic> |
findByValue(String search)
Finds all Characteristics whose value match the given search term
|
Map<String,Characteristic> |
findCharacteristicsByValueUriOrValueLikeGroupedByNormalizedValue(String value)
Find characteristics by value matching the provided LIKE pattern.
|
Map<Class<? extends Identifiable>,Map<String,Set<ExpressionExperiment>>> |
findExperimentsByUris(Collection<String> uris,
Taxon taxon,
int limit)
This search looks at direct annotations, factor values and biomaterials in that order.
|
Map<Characteristic,Long> |
getParentIds(Class<?> parentClass,
Collection<Characteristic> characteristics)
Optimized version that only retrieves the IDs of the owning objects.
|
Map<Characteristic,Object> |
getParents(Class<?> parentClass,
Collection<Characteristic> characteristics) |
String |
normalizeByValue(Characteristic characteristic)
Normalize a characteristic by value.
|
doLoadValueObjects, loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds
countAll, create, create, createInBatch, find, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, flush, getElementClass, getSessionFactory, load, load, loadAll, remove, remove, remove, removeAllInBatch, removeInBatch, save, save, saveInBatch, update, update, updateInBatch
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds
countAll, create, create, createInBatch, find, findOrCreate, getElementClass, load, load, loadAll, remove, remove, remove, removeAllInBatch, removeInBatch, save, save, saveInBatch, update, update, updateInBatch
@Autowired public CharacteristicDaoImpl(SessionFactory sessionFactory)
public List<Characteristic> browse(int start, int limit)
CharacteristicDao
browse
in interface BrowsingDao<Characteristic>
browse
in interface CharacteristicDao
start
- How far into the list to startlimit
- Maximum records to retrieve (might be subject to security filtering)public List<Characteristic> browse(int start, int limit, String orderField, boolean descending)
CharacteristicDao
browse
in interface BrowsingDao<Characteristic>
browse
in interface CharacteristicDao
start
- query offsetlimit
- maximum amount of entriesorderField
- order fielddescending
- order directionpublic Collection<? extends Characteristic> findByCategory(String query)
findByCategory
in interface CharacteristicDao
public Collection<Characteristic> findByUri(Collection<Class<?>> classes, @Nullable Collection<String> characteristicUris)
findByUri
in interface CharacteristicDao
classes
- constraint of who the 'owner' of the Characteristic has to be.characteristicUris
- urispublic Map<Class<? extends Identifiable>,Map<String,Set<ExpressionExperiment>>> findExperimentsByUris(Collection<String> uris, @Nullable Taxon taxon, int limit)
CharacteristicDao
Resulting EEs are filtered by ACLs.
findExperimentsByUris
in interface CharacteristicDao
uris
- collection of URIs used for matching characteristics (via Characteristic.getValueUri()
)taxon
- taxon to restrict EEs to, or null to ignorelimit
- approximate limit to how many results to return (just used to avoid extra queries; the limit
may be exceeded). Set to 0 for no limit.ExpressionExperiment
, FactorValue
,
BioMaterial
) to the matching URI to IDs of experiments which have
an associated characteristic using the given uriString. The class lets us track where the annotation was.public Collection<Characteristic> findByUri(Collection<String> uris)
findByUri
in interface CharacteristicDao
public Collection<Characteristic> findByUri(String searchString)
findByUri
in interface CharacteristicDao
public Map<String,Long> countCharacteristicsByValueUriGroupedByNormalizedValue(Collection<String> uris)
CharacteristicDao
The mapping key is the normalized value of the characteristics as per CharacteristicDao.normalizeByValue(Characteristic)
.
countCharacteristicsByValueUriGroupedByNormalizedValue
in interface CharacteristicDao
public Map<String,Characteristic> findCharacteristicsByValueUriOrValueLikeGroupedByNormalizedValue(String value)
CharacteristicDao
The mapping key is the normalized value of the characteristics as per CharacteristicDao.normalizeByValue(Characteristic)
.
findCharacteristicsByValueUriOrValueLikeGroupedByNormalizedValue
in interface CharacteristicDao
public String normalizeByValue(Characteristic characteristic)
CharacteristicDao
This is obtained by taking the value URI or value if the former is null and converting it to lowercase.
normalizeByValue
in interface CharacteristicDao
public Collection<Characteristic> findByValue(String search)
CharacteristicDao
findByValue
in interface CharacteristicDao
search
- searchpublic Map<Characteristic,Object> getParents(Class<?> parentClass, @Nullable Collection<Characteristic> characteristics)
getParents
in interface CharacteristicDao
parentClass
- parent classcharacteristics
- characteristicspublic Map<Characteristic,Long> getParentIds(Class<?> parentClass, @Nullable Collection<Characteristic> characteristics)
CharacteristicDao
getParentIds
in interface CharacteristicDao
protected CharacteristicValueObject doLoadValueObject(Characteristic entity)
AbstractVoEnabledDao
This should be fast and efficient, and avoid any database query or post-processing. If you need to perform
additional queries, consider overriding AbstractVoEnabledDao.loadValueObject(Identifiable)
or AbstractVoEnabledDao.loadValueObjects(Collection)
.
doLoadValueObject
in class AbstractVoEnabledDao<Characteristic,CharacteristicValueObject>
Copyright © 2005–2023 Pavlidis lab, Michael Smith Laboratories and Department of Psychiatry, University of British Columbia. All rights reserved.