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) |
org.apache.commons.lang3.builder.DiffResult |
removeAttribute(T entity,
String attributeName) |
org.apache.commons.lang3.builder.DiffResult |
removeAttribute(T entity,
String attributeName,
String attributeValue) |
protected org.apache.commons.lang3.builder.DiffResult |
storeAttributes(T entityWithAttributes,
Map<String,Set<String>> attributesToSet)
Stores entity attributes.
|
protected void |
updateTimestamps(InternalEntity entity,
boolean updateCreatedDate) |
createDeleteQuery, createDeleteQuery, createQuery, createQuery, 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)
public org.apache.commons.lang3.builder.DiffResult removeAttribute(T entity, String attributeName)
public org.apache.commons.lang3.builder.DiffResult removeAttribute(T entity, String attributeName, String attributeValue)
entity
- The entity to remove attributes fromattributeName
- The name of the attribute to removeattributeValue
- The value of the attribute to removeDiffResult
object that encapsulates the identified differences between the original and updated attributes.protected void updateTimestamps(InternalEntity entity, boolean updateCreatedDate)
public abstract T findByName(long directoryId, String entityName) throws ObjectNotFoundException
ObjectNotFoundException
protected org.apache.commons.lang3.builder.DiffResult storeAttributes(T entityWithAttributes, Map<String,Set<String>> attributesToSet)
It is not possible to completely remove an attribute using this method. If removal is needed then
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 entityWithAttributesDiffResult
object that encapsulates the identified differences between the original and updated attributes.protected <V> List<V> executeBatchedQueriesIfNecessary(EntityQuery<V> entityQuery, List<HQLQuery> hqlQueries)
Copyright © 2024 Atlassian. All rights reserved.