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.CacheFactorycacheFactoryprotected ConfluenceUserDaoconfluenceUserDao
-
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.longfindLatestVersionsCount()Returns the number of results for the latest versions of the current persistent class.protected longfindLatestVersionsCount(String... statuses)Iterator<T>findLatestVersionsIterator()Returns an iterator for the latest versions of the current persistent class.protected Iterator<T>findLatestVersionsIterator(String... statuses)protected ListfindNamedQueryStringParams(String queryName, boolean cacheable, LimitedRequest limitedRequest, Object... paramNamesAndValues)Deprecated.since 5.8 Use the equivalent method that uses theHibernateObjectDao.Cacheabilityenum instead of the cacheable boolean flagprotected ListfindNamedQueryStringParams(String queryName, HibernateObjectDao.Cacheability cacheability, LimitedRequest limitedRequest, Object... paramNamesAndValues)This method here instead of inHibernateObjectDaoin bucket because we don't want to update bucket right now.voidsave(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject previousVersion)Deprecated.since 6.10.0.voidsaveEntity(T objectToSave, @Nullable T previousVersion)Saves the given current object and historical object.voidsetCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)Deprecated.since 5.10.voidsetConfluenceUserDao(ConfluenceUserDao confluenceUserDao)Deprecated.since 5.10.protected voidupdateEntityModificationData(T objectToSave)protected voidupdateModificationData(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:VersionedObjectDaoReturns an iterator for the latest versions of the current persistent class.- Specified by:
findLatestVersionsIteratorin interfaceVersionedObjectDao<T extends com.atlassian.core.bean.EntityObject>- Returns:
- Iterator
-
findLatestVersionsCount
public long findLatestVersionsCount()
Description copied from interface:VersionedObjectDaoReturns the number of results for the latest versions of the current persistent class.- Specified by:
findLatestVersionsCountin 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:ObjectDaoInternalFind all objects currently persisted of a particular type and sort results by named property.- Specified by:
findAllSortedin interfaceObjectDao- Specified by:
findAllSortedin interfaceObjectDaoInternal<T extends com.atlassian.core.bean.EntityObject>- Overrides:
findAllSortedin 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:VersionedObjectDaoInternalSaves the given current object and historical object.- Specified by:
saveEntityin 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:VersionedObjectDaoSaves the given current object and historical object- Specified by:
savein 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:HibernateObjectDaoPerform 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:
updateModificationDatain 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:
updateEntityModificationDatain 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.Cacheabilityenum instead of the cacheable boolean flag
-
findNamedQueryStringParams
protected List findNamedQueryStringParams(String queryName, HibernateObjectDao.Cacheability cacheability, LimitedRequest limitedRequest, Object... paramNamesAndValues)
This method here instead of inHibernateObjectDaoin 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.
-
-