Class AbstractCuratableDao<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean,BaseDao<C>,BaseVoEnabledDao<C,,VO> CachedFilteringDao<C>,CachedFilteringVoEnabledDao<C,,VO> CuratableDao<C>,FilteringDao<C>,FilteringVoEnabledDao<C,VO>
- Direct Known Subclasses:
ArrayDesignDaoImpl,ExpressionExperimentDaoImpl
- Author:
- tesarst
-
Nested Class Summary
Nested classes/interfaces inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer, AbstractFilteringVoEnabledDao.FilterablePropertyMeta -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringHQL alias forCuratable.getCurationDetails().Fields inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDao
REPORT_SLOW_QUERY_AFTER_MSFields inherited from class ubic.gemma.persistence.service.AbstractDao
log -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCuratableDao(String objectAlias, Class<C> elementClass, SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddEventsToMap(Map<Long, Collection<AuditEvent>> eventMap, Long id, AuditEvent event) protected voidaddNonTroubledFilter(Filters filters, String objectAlias) Restrict results to non-troubled curatable entities for non-administratorsprotected voidconfigureFilterableProperties(AbstractFilteringVoEnabledDao<C, VO>.FilterablePropertiesConfigurer configurer) Register filterable properties.protected StringIf the filters or sort refer to one of the one-to-many relations, multiple rows will be returned per datasets, so the query has to use a "distinct" clause make pagination work properly.protected StringformNativeNonTroubledClause(String idColumn, Class<? extends Curatable> clazz) Form a native non-troubled clause.protected StringformNonTroubledClause(String objectAlias, Class<? extends Curatable> clazz) Form a non-troubled clause.protected StringgroupByIfNecessary(Sort sort, String... oneToManyAliases) Similar logic todistinctIfNecessary(), but using a group by since it's more efficient.Load IDs of troubled entities.resolveFilterablePropertyMeta(String propertyName) voidupdateCurationDetailsFromAuditEvent(C curatable, AuditEvent auditEvent) Update the curation details of a given curatable entity.Methods inherited from class ubic.gemma.persistence.service.AbstractQueryFilteringVoEnabledDao
count, countWithCache, getEntityTransformer, getFilteringCountQuery, getFilteringIdQuery, getFilteringQuery, getValueObjectTransformer, initializeCachedFilteringResult, load, load, loadIds, loadIdsWithCache, loadValueObjects, loadValueObjects, loadValueObjectsWithCache, loadValueObjectsWithCache, loadWithCache, loadWithCacheMethods inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
afterPropertiesSet, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyMeta, getFilterablePropertyType, getSort, isFilterablePropertyDeprecated, isFilterablePropertyUsingSubquery, resolveFilterablePropertyMetaMethods inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDao
doLoadValueObject, doLoadValueObjects, loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds, postProcessValueObjectsMethods inherited from class ubic.gemma.persistence.service.AbstractDao
countAll, create, create, find, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, getBatchSize, getElementClass, getEntityName, getIdentifierPropertyName, getSessionFactory, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, streamQuery, update, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ubic.gemma.persistence.service.BaseDao
countAll, create, create, find, findOrCreate, getElementClass, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, update, updateMethods inherited from interface ubic.gemma.persistence.service.BaseVoEnabledDao
loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIdsMethods inherited from interface ubic.gemma.persistence.service.FilteringDao
getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyType, getSort, isFilterablePropertyDeprecated, isFilterablePropertyUsingSubquery
-
Field Details
-
CURATION_DETAILS_ALIAS
HQL alias forCuratable.getCurationDetails().- See Also:
-
-
Constructor Details
-
AbstractCuratableDao
protected AbstractCuratableDao(String objectAlias, Class<C> elementClass, SessionFactory sessionFactory)
-
-
Method Details
-
loadTroubledIds
Description copied from interface:CuratableDaoLoad IDs of troubled entities.- Specified by:
loadTroubledIdsin interfaceCuratableDao<C extends Curatable>
-
updateCurationDetailsFromAuditEvent
Description copied from interface:CuratableDaoUpdate the curation details of a given curatable entity.This method should only be called from
AuditTrailService, as the passed event has to already exist in the audit trail of the curatable object.Only use this method directly if you do not want the event to show up in the curatable objects audit trail.
This is marked as ignored for audit purposes since we don't want to audit the curation details update when it originated from an audit event.
- Specified by:
updateCurationDetailsFromAuditEventin interfaceCuratableDao<C extends Curatable>- Parameters:
curatable- curatableauditEvent- the event containing information about the update. Method only accepts audit events whose type is one ofCurationDetailsEventextensions.- See Also:
-
addEventsToMap
-
addNonTroubledFilter
Restrict results to non-troubled curatable entities for non-administrators -
distinctIfNecessary
If the filters or sort refer to one of the one-to-many relations, multiple rows will be returned per datasets, so the query has to use a "distinct" clause make pagination work properly.Using "distinct" otherwise has a steep performance penalty when combined with "order by".
Note that non-admin users always need a group by because of the jointure on ACL entries.
-
groupByIfNecessary
Similar logic todistinctIfNecessary(), but using a group by since it's more efficient. It does not work for the counting queries, however. -
formNonTroubledClause
Form a non-troubled clause. -
formNativeNonTroubledClause
Form a native non-troubled clause. -
configureFilterableProperties
@OverridingMethodsMustInvokeSuper protected void configureFilterableProperties(AbstractFilteringVoEnabledDao<C, VO>.FilterablePropertiesConfigurer configurer) Description copied from class:AbstractFilteringVoEnabledDaoRegister filterable properties.- Overrides:
configureFilterablePropertiesin classAbstractFilteringVoEnabledDao<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
-
resolveFilterablePropertyMeta
protected AbstractFilteringVoEnabledDao.FilterablePropertyMeta.FilterablePropertyMetaBuilder resolveFilterablePropertyMeta(String propertyName) throws IllegalArgumentException Obtain various meta-information used to infer what to use in aFilterorSort.This is used by
AbstractFilteringVoEnabledDao.getFilter(String, Filter.Operator, String)andFilteringDao.getSort(String, Sort.Direction, Sort.NullMode).Include filtering by
lastUpdated,troubledandneedsAttentionfrom the associated curation details.- Overrides:
resolveFilterablePropertyMetain classAbstractFilteringVoEnabledDao<C extends Curatable,VO extends AbstractCuratableValueObject<C>> - Throws:
IllegalArgumentException- if no such propertyName exists inAbstractFilteringVoEnabledDao- See Also:
-