Class VersionedHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
-
- com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<T>
-
- All Implemented Interfaces:
ObjectDao
,VersionedObjectDao<T>
,ObjectDaoInternal<T>
,VersionedObjectDaoInternal<T>
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AbstractContentEntityObjectHibernateDao
,AbstractHibernateAttachmentDao
,ConfluenceHibernateObjectDao
,ContentPermissionHibernateDao
,HibernateSpacePermissionDao
public abstract class VersionedHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject> extends HibernateObjectDao<T> implements VersionedObjectDaoInternal<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
HibernateObjectDao.Cacheability
-
-
Field Summary
Fields Modifier and Type Field Description protected com.atlassian.cache.CacheFactory
cacheFactory
protected ConfluenceUserDao
confluenceUserDao
-
Constructor Summary
Constructors Constructor Description VersionedHibernateObjectDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description @NonNull List<T>
findAllSorted(String sortField)
Find all objects currently persisted of a particular type and sort results by named property.long
findLatestVersionsCount()
Returns the number of results for the latest versions of the current persistent class.protected long
findLatestVersionsCount(String... statuses)
Iterator<T>
findLatestVersionsIterator()
Returns an iterator for the latest versions of the current persistent class.protected Iterator<T>
findLatestVersionsIterator(String... statuses)
protected List
findNamedQueryStringParams(String queryName, boolean cacheable, LimitedRequest limitedRequest, Object... paramNamesAndValues)
Deprecated.since 5.8 Use the equivalent method that uses theHibernateObjectDao.Cacheability
enum instead of the cacheable boolean flagprotected List
findNamedQueryStringParams(String queryName, HibernateObjectDao.Cacheability cacheability, LimitedRequest limitedRequest, Object... paramNamesAndValues)
This method here instead of inHibernateObjectDao
in bucket because we don't want to update bucket right now.void
save(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject previousVersion)
Deprecated.since 6.10.0.void
saveEntity(T objectToSave, @Nullable T previousVersion)
Saves the given current object and historical object.void
setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
Deprecated.since 5.10.void
setConfluenceUserDao(ConfluenceUserDao confluenceUserDao)
Deprecated.since 5.10.protected void
updateEntityModificationData(T objectToSave)
protected void
updateModificationData(com.atlassian.core.bean.EntityObject objectToSave)
Perform any modifications that need to be done to an object every time it is saved.-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, getHibernateTemplate, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setEventPublisher, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ObjectDaoInternal
findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, getPersistentClass, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
-
-
-
-
Field Detail
-
cacheFactory
protected com.atlassian.cache.CacheFactory cacheFactory
-
confluenceUserDao
protected ConfluenceUserDao confluenceUserDao
-
-
Method Detail
-
findLatestVersionsIterator
public Iterator<T> findLatestVersionsIterator()
Description copied from interface:VersionedObjectDao
Returns an iterator for the latest versions of the current persistent class.- Specified by:
findLatestVersionsIterator
in interfaceVersionedObjectDao<T extends com.atlassian.core.bean.EntityObject>
- Returns:
- Iterator
-
findLatestVersionsCount
public long findLatestVersionsCount()
Description copied from interface:VersionedObjectDao
Returns the number of results for the latest versions of the current persistent class.- Specified by:
findLatestVersionsCount
in interfaceVersionedObjectDao<T extends com.atlassian.core.bean.EntityObject>
- Returns:
- a long representing the number of results
-
findLatestVersionsCount
protected long findLatestVersionsCount(String... statuses)
-
findAllSorted
public @NonNull List<T> findAllSorted(String sortField)
Description copied from interface:ObjectDaoInternal
Find all objects currently persisted of a particular type and sort results by named property.- Specified by:
findAllSorted
in interfaceObjectDao
- Specified by:
findAllSorted
in interfaceObjectDaoInternal<T extends com.atlassian.core.bean.EntityObject>
- Overrides:
findAllSorted
in classHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>
- Parameters:
sortField
- the name of the property to be sorted on. This should be null if no sorting is required.
-
saveEntity
public void saveEntity(T objectToSave, @Nullable T previousVersion)
Description copied from interface:VersionedObjectDaoInternal
Saves the given current object and historical object.- Specified by:
saveEntity
in interfaceVersionedObjectDaoInternal<T extends com.atlassian.core.bean.EntityObject>
- Parameters:
objectToSave
- the current object.previousVersion
- the original object. This will be mutated to become a historical version as part of this save.
-
save
@Deprecated public void save(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject previousVersion)
Deprecated.since 6.10.0. UsesaveEntity(EntityObject, EntityObject)
instead.Description copied from interface:VersionedObjectDao
Saves the given current object and historical object- Specified by:
save
in interfaceVersionedObjectDao<T extends com.atlassian.core.bean.EntityObject>
- Parameters:
objectToSave
- the current object.previousVersion
- the original object. This will be mutated to become a historical version as part of this save.
-
updateModificationData
protected void updateModificationData(com.atlassian.core.bean.EntityObject objectToSave)
Description copied from class:HibernateObjectDao
Perform any modifications that need to be done to an object every time it is saved. The default implementation updates the last-modified timestamp, and sets the creation timestamp if it has not yet been set.- Overrides:
updateModificationData
in classHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>
- Parameters:
objectToSave
- the object that is about to be saved
-
updateEntityModificationData
protected void updateEntityModificationData(T objectToSave)
- Overrides:
updateEntityModificationData
in classHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>
-
findNamedQueryStringParams
@Deprecated protected List findNamedQueryStringParams(String queryName, boolean cacheable, LimitedRequest limitedRequest, Object... paramNamesAndValues)
Deprecated.since 5.8 Use the equivalent method that uses theHibernateObjectDao.Cacheability
enum instead of the cacheable boolean flag
-
findNamedQueryStringParams
protected List findNamedQueryStringParams(String queryName, HibernateObjectDao.Cacheability cacheability, LimitedRequest limitedRequest, Object... paramNamesAndValues)
This method here instead of inHibernateObjectDao
in bucket because we don't want to update bucket right now.
-
setCacheFactory
@Deprecated public void setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
Deprecated.since 5.10. Subclasses should implement this themselves.
-
setConfluenceUserDao
@Deprecated public void setConfluenceUserDao(ConfluenceUserDao confluenceUserDao)
Deprecated.since 5.10. Subclasses should implement this themselves.
-
-