T
- An InternalDirectoryEntity
, which an implementation of this DAO is handlingU
- An InternalEntityAttribute
, which the T type uses for its attributespublic abstract class InternalDirectoryEntityHibernateDao<T extends InternalDirectoryEntity<U>,U extends InternalEntityAttribute> extends HibernateDao<T>
InternalDirectoryEntity
, it has common logic for operating on attributesbatchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSource
sessionFactory
Constructor and Description |
---|
InternalDirectoryEntityHibernateDao() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addAttribute(T entity,
String attributeName,
String attributeValue) |
protected <V> List<V> |
executeBatchedQueriesIfNecessary(EntityQuery<V> entityQuery,
List<HQLQuery> hqlQueries) |
abstract T |
findByName(long directoryId,
String entityName) |
void |
removeAttribute(T entity,
String attributeName) |
void |
removeAttribute(T entity,
String attributeName,
String attributeValue) |
protected void |
storeAttributes(T entityWithAttributes,
Map<String,Set<String>> attributesToSet)
Stores entity attributes.
|
protected void |
updateTimestamps(InternalEntity entity,
boolean updateCreatedDate) |
createDeleteQuery, createDeleteQuery, createQuery, createQuery, executeHQLQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, getCountByProperties, getPersistentClass, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, update
setSessionFactory, withStatelessSession
public abstract void addAttribute(T entity, String attributeName, String attributeValue)
protected void updateTimestamps(InternalEntity entity, boolean updateCreatedDate)
public abstract T findByName(long directoryId, String entityName) throws ObjectNotFoundException
ObjectNotFoundException
protected void storeAttributes(T entityWithAttributes, Map<String,Set<String>> attributesToSet)
removeAttribute(InternalDirectoryEntity, String)
should be used instead.entityWithAttributes
- The InternalDirectoryEntity
which will have its attributes updatedattributesToSet
- A map of attributes to attribute values which will be updated/added to entityWithAttributesprotected <V> List<V> executeBatchedQueriesIfNecessary(EntityQuery<V> entityQuery, List<HQLQuery> hqlQueries)
Copyright © 2020 Atlassian. All rights reserved.