Class PluginContentHibernateDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
-
- com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<T>
-
- com.atlassian.confluence.internal.persistence.hibernate.AbstractContentEntityObjectHibernateDao<CustomContentEntityObject>
-
- com.atlassian.confluence.content.persistence.hibernate.PluginContentHibernateDao
-
- All Implemented Interfaces:
ObjectDao
,CustomContentDao
,ContentEntityObjectDao<CustomContentEntityObject>
,VersionedObjectDao<CustomContentEntityObject>
,ContentEntityObjectDaoInternal<CustomContentEntityObject>
,ObjectDaoInternal<CustomContentEntityObject>
,VersionedObjectDaoInternal<CustomContentEntityObject>
,org.springframework.beans.factory.InitializingBean
public class PluginContentHibernateDao extends AbstractContentEntityObjectHibernateDao<CustomContentEntityObject> implements CustomContentDao, org.springframework.beans.factory.InitializingBean
Hibernate Implementation of the CustomContentDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
HibernateObjectDao.Cacheability
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory, confluenceUserDao
-
-
Constructor Summary
Constructors Constructor Description PluginContentHibernateDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
countChildrenOfType(long parentId, String pluginModuleKey)
Iterator<CustomContentEntityObject>
findAll(String pluginContentKey)
Retrieves an iterator ofCustomContentEntityObject
with the specified pluginContentKeyIterator<CustomContentEntityObject>
findAllChildren(long parentId)
Retrieves all children of the specified content.Iterator<CustomContentEntityObject>
findAllContainedOfType(long containerContentId, String pluginContentKey)
Iterator<CustomContentEntityObject>
findAllInSpace(long spaceId)
Iterator<CustomContentEntityObject>
findAllInSpace(String pluginModuleKey, long spaceId)
Iterator<CustomContentEntityObject>
findAllInSpaceWithAttachments(long spaceId)
Iterator<CustomContentEntityObject>
findAllInSpaceWithAttachments(String pluginModuleKey, long spaceId)
Iterator<CustomContentEntityObject>
findAllWithAttachments(String pluginContentKey)
Retrieves an iterator ofCustomContentEntityObject
with the specified pluginContentKey.<T> PageResponse<T>
findByQuery(ContentQuery<T> contentQuery, boolean cacheable, LimitedRequest limitedRequest, com.google.common.base.Predicate<T> predicate)
Deprecated.since 7.0.1.<T> Iterator<T>
findByQuery(ContentQuery<T> contentQuery, int offset, int maxResults)
Iterator<CustomContentEntityObject>
findChildrenOfType(long parentId, String pluginModuleKey, int offset, int maxResults, CustomContentManager.SortField sortField, CustomContentManager.SortOrder sortOrder)
Iterator<CustomContentEntityObject>
findCurrentInSpace(long spaceId, String pluginModuleKey, int offset, int maxResults, CustomContentManager.SortField sortField, CustomContentManager.SortOrder sortOrder)
int
findTotalInSpace(long spaceId, String pluginModuleKey)
Class<CustomContentEntityObject>
getPersistentClass()
Gets the type ofEntityObject
this Dao works with.<T,R>
Rquery(ContentQuery<T> contentQuery, int offset, int maxResults, Function<org.hibernate.query.Query<T>,R> f)
<T> List<T>
queryForList(ContentQuery<T> contentQuery)
It is strongly recommended that theCustomContentDao.queryForList(ContentQuery, int, int)
method be used in preference to this one, as this method does not apply pagination limits to the result set.<T> List<T>
queryForList(ContentQuery<T> contentQuery, int offset, int maxResults)
void
saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
This is for internal use only, Do not rely on it as a public API.void
setDatabaseCapabilities(HibernateDatabaseCapabilities databaseCapabilities)
void
setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
-
Methods inherited from class com.atlassian.confluence.internal.persistence.hibernate.AbstractContentEntityObjectHibernateDao
countContentBySpaceIdAndStatus, findAllDraftsFor, findAllLegacyDraftsFor, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findDraftFor, findDraftsWithUnpublishedChangesForUser, findHistoricalVersionsAfterVersion, findPreviousVersions, findUnpublishedContentWithUserContributions, getAllCurrentEntities, getAllModifiers, getByClassId, getById, getContentAuthoredByUser, getContributionStatusByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getObjectType, getOldestPageCreationDate, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getPagesByCursor, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getTrashedContents, getTrashedContents, getTrashedEntities, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNew
-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDao, updateEntityModificationData, updateModificationData
-
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, 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.core.persistence.ContentEntityObjectDao
countContentBySpaceIdAndStatus, findAllDraftsFor, findAllLegacyDraftsFor, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findDraftFor, findDraftsWithUnpublishedChangesForUser, findHistoricalVersionsAfterVersion, findPreviousVersions, findUnpublishedContentWithUserContributions, getAllCurrentEntities, getAllModifiers, getAllModifiers, getById, getContentAuthoredByUser, getContributionStatusByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getObjectType, getOldestPageCreationDate, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getTrashedContents, getTrashedContents, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNew
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ContentEntityObjectDaoInternal
findContentBySpaceIdAndStatusAndFilter
-
Methods inherited from interface com.atlassian.confluence.content.persistence.CustomContentDao
findByQueryAndFilter
-
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ObjectDaoInternal
findAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
-
Methods inherited from interface com.atlassian.confluence.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.VersionedObjectDaoInternal
saveEntity
-
-
-
-
Method Detail
-
getPersistentClass
public Class<CustomContentEntityObject> getPersistentClass()
Description copied from interface:ObjectDaoInternal
Gets the type ofEntityObject
this Dao works with.- Specified by:
getPersistentClass
in interfaceObjectDao
- Specified by:
getPersistentClass
in interfaceObjectDaoInternal<CustomContentEntityObject>
- Returns:
- the type
-
setPluginAccessor
public void setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
-
setDatabaseCapabilities
public void setDatabaseCapabilities(HibernateDatabaseCapabilities databaseCapabilities)
- Since:
- 7.20
-
findByQuery
public <T> Iterator<T> findByQuery(ContentQuery<T> contentQuery, int offset, int maxResults)
- Specified by:
findByQuery
in interfaceCustomContentDao
-
queryForList
public <T> List<T> queryForList(ContentQuery<T> contentQuery, int offset, int maxResults)
- Specified by:
queryForList
in interfaceCustomContentDao
- Since:
- 7.14
-
query
public <T,R> R query(ContentQuery<T> contentQuery, int offset, int maxResults, Function<org.hibernate.query.Query<T>,R> f)
-
queryForList
public <T> List<T> queryForList(ContentQuery<T> contentQuery)
Description copied from interface:CustomContentDao
It is strongly recommended that theCustomContentDao.queryForList(ContentQuery, int, int)
method be used in preference to this one, as this method does not apply pagination limits to the result set. This can result in excessive memory pressure. This method should only be used when the query is self-limiting, or when the size of the result set is otherwise known in advance.- Specified by:
queryForList
in interfaceCustomContentDao
- Since:
- 7.16
-
findByQuery
@Deprecated public <T> PageResponse<T> findByQuery(ContentQuery<T> contentQuery, boolean cacheable, LimitedRequest limitedRequest, com.google.common.base.Predicate<T> predicate)
Deprecated.- Specified by:
findByQuery
in interfaceCustomContentDao
-
findTotalInSpace
public int findTotalInSpace(long spaceId, String pluginModuleKey)
- Specified by:
findTotalInSpace
in interfaceCustomContentDao
-
findCurrentInSpace
public Iterator<CustomContentEntityObject> findCurrentInSpace(long spaceId, String pluginModuleKey, int offset, int maxResults, CustomContentManager.SortField sortField, CustomContentManager.SortOrder sortOrder)
- Specified by:
findCurrentInSpace
in interfaceCustomContentDao
-
findAllInSpaceWithAttachments
public Iterator<CustomContentEntityObject> findAllInSpaceWithAttachments(String pluginModuleKey, long spaceId)
- Specified by:
findAllInSpaceWithAttachments
in interfaceCustomContentDao
-
findAllInSpace
public Iterator<CustomContentEntityObject> findAllInSpace(String pluginModuleKey, long spaceId)
- Specified by:
findAllInSpace
in interfaceCustomContentDao
-
findAllInSpaceWithAttachments
public Iterator<CustomContentEntityObject> findAllInSpaceWithAttachments(long spaceId)
- Specified by:
findAllInSpaceWithAttachments
in interfaceCustomContentDao
-
findAllInSpace
public Iterator<CustomContentEntityObject> findAllInSpace(long spaceId)
- Specified by:
findAllInSpace
in interfaceCustomContentDao
-
findAll
public Iterator<CustomContentEntityObject> findAll(String pluginContentKey)
Description copied from interface:CustomContentDao
Retrieves an iterator ofCustomContentEntityObject
with the specified pluginContentKey- Specified by:
findAll
in interfaceCustomContentDao
- Parameters:
pluginContentKey
- CustomContentEntityObject with this plugin content key will be returned- Returns:
- iterator of
CustomContentEntityObject
-
findAllWithAttachments
public Iterator<CustomContentEntityObject> findAllWithAttachments(String pluginContentKey)
Description copied from interface:CustomContentDao
Retrieves an iterator ofCustomContentEntityObject
with the specified pluginContentKey. We are loading- Specified by:
findAllWithAttachments
in interfaceCustomContentDao
- Parameters:
pluginContentKey
- CustomContentEntityObject with this plugin content key will be returned- Returns:
- iterator of
CustomContentEntityObject
-
findAllChildren
public Iterator<CustomContentEntityObject> findAllChildren(long parentId)
Description copied from interface:CustomContentDao
Retrieves all children of the specified content.- Specified by:
findAllChildren
in interfaceCustomContentDao
- Parameters:
parentId
- children of this content entity will be returned- Returns:
- iterator of
CustomContentEntityObject
-
findChildrenOfType
public Iterator<CustomContentEntityObject> findChildrenOfType(long parentId, String pluginModuleKey, int offset, int maxResults, CustomContentManager.SortField sortField, CustomContentManager.SortOrder sortOrder)
- Specified by:
findChildrenOfType
in interfaceCustomContentDao
-
countChildrenOfType
public long countChildrenOfType(long parentId, String pluginModuleKey)
- Specified by:
countChildrenOfType
in interfaceCustomContentDao
-
findAllContainedOfType
public Iterator<CustomContentEntityObject> findAllContainedOfType(long containerContentId, String pluginContentKey)
- Specified by:
findAllContainedOfType
in interfaceCustomContentDao
-
saveRawWithoutReindex
public void saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
Description copied from interface:ContentEntityObjectDaoInternal
This is for internal use only, Do not rely on it as a public API.
Perform a saveRaw but without performing the re-index; it is unnecessary in the context of a migration or upgrade.
- Specified by:
saveRawWithoutReindex
in interfaceContentEntityObjectDaoInternal<CustomContentEntityObject>
-
-