Class HibernateCommentDao
java.lang.Object
org.springframework.dao.support.DaoSupport
com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao<T>
com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<Comment>
com.atlassian.confluence.pages.persistence.dao.hibernate.HibernateCommentDao
- All Implemented Interfaces:
CommentDaoInternal
,CommentDao
,org.springframework.beans.factory.InitializingBean
public class HibernateCommentDao
extends VersionedHibernateObjectDao<Comment>
implements CommentDaoInternal
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
HibernateObjectDao.Cacheability
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Count the total number of comments of all types, including previous versionslong
countCommentByStatuses
(List<ContentStatus> contentStatuses) Retrieve the latest content count of specific content type for a given space with a particular status.int
countComments
(Searchable searchable) Count all comments in a searchable contentcountComments
(Collection<? extends Searchable> searchables) Count all comments for each content in a collectionlong
countSpaceCommentByStatuses
(Space space, List<ContentStatus> contentStatuses) Retrieve the latest content count of specific content type for a given space with a particular status.countUnresolvedComments
(@NonNull Collection<Long> containerIds) Count unresolved comments of comment containers.protected Comment
getByClassId
(long id) Retrieve the object with a particular id from the database.getById
(long id) Get a comment by its idgetChildren
(Comment comment, LimitedRequest pageRequest) getContainerComments
(long containerId, LimitedRequest pageRequest) getContainerComments
(long containerId, Date since) Get the comments that have been added or updated since a specific timegetContainerComments
(long containerId, Date since, ConfluenceUser ignoreUser) Get the comments that have been added or updated since a specific time but not by a usergetRecentlyUpdatedComments
(long spaceId, int maxResults) Get all comments that have been updated recently in a spaceprotected void
scanFilteredComments
(List<ContentStatus> statuses, LimitedRequest pageRequest) scanFilteredSpaceComments
(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest) void
setEventPublisher
(com.atlassian.event.api.EventPublisher eventPublisher) Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
applyChildVersioningPolicy, findAllSorted, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, remove, save
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao
findNamedQueryStringParams, getContentStatusStringList, getStatusNames, scanFilteredContents, scanFilteredContents, updateModificationData
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, getHibernateTemplate, getSessionFactory, reIndex, save, saveEntity, saveRaw, setHibernateTemplate, setSessionFactory, uniqueResult
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
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.pages.persistence.CommentDaoInternal
save
-
Constructor Details
-
HibernateCommentDao
public HibernateCommentDao()
-
-
Method Details
-
getPersistentClass
- Specified by:
getPersistentClass
in classHibernateObjectDao<Comment>
-
getById
Description copied from interface:CommentDao
Get a comment by its id- Specified by:
getById
in interfaceCommentDao
- Parameters:
id
- the comment's id- Returns:
- the comment object
-
getByClassId
Description copied from class:HibernateObjectDao
Retrieve the object with a particular id from the database. The object must be of the same class as the DAO's getPersistentClass() method returns.- Overrides:
getByClassId
in classHibernateObjectDao<Comment>
- Parameters:
id
- the id of the object to look up- Returns:
- the corresponding object, or null if the object does not exist with the appropriate class and id.
-
getRecentlyUpdatedComments
Description copied from interface:CommentDao
Get all comments that have been updated recently in a space- Specified by:
getRecentlyUpdatedComments
in interfaceCommentDao
- Parameters:
spaceId
- the space's idmaxResults
- the maximum number of comments that can be retrieved- Returns:
- a
Iterator
object that encapsulates the list of comments found
-
getContainerComments
Description copied from interface:CommentDao
Get the comments that have been added or updated since a specific time- Specified by:
getContainerComments
in interfaceCommentDao
- Parameters:
containerId
- the container's idsince
-Date
the time after which the comments have been added or updated- Returns:
- a list of comments created or updated
-
getContainerComments
Description copied from interface:CommentDao
Get the comments that have been added or updated since a specific time but not by a user- Specified by:
getContainerComments
in interfaceCommentDao
- Parameters:
containerId
- the container's idsince
-Date
the time after which the comments have been added or updatedignoreUser
- the user to be ignored- Returns:
- a list of comments created or updated
-
countComments
Description copied from interface:CommentDao
Count all comments for each content in a collection- Specified by:
countComments
in interfaceCommentDao
- Parameters:
searchables
- a collection ofSearchable
objects representing the contents- Returns:
- a map of counts for each searchable content
-
countComments
Description copied from interface:CommentDao
Count all comments in a searchable content- Specified by:
countComments
in interfaceCommentDao
- Parameters:
searchable
- aSearchable
object representing the content- Returns:
- a number of comments in the searchable content
-
countAllCommentVersions
public int countAllCommentVersions()Description copied from interface:CommentDao
Count the total number of comments of all types, including previous versions- Specified by:
countAllCommentVersions
in interfaceCommentDao
- Returns:
- the total number of comments
-
getContainerComments
- Specified by:
getContainerComments
in interfaceCommentDao
-
getChildren
- Specified by:
getChildren
in interfaceCommentDao
-
countUnresolvedComments
Description copied from interface:CommentDao
Count unresolved comments of comment containers.- Specified by:
countUnresolvedComments
in interfaceCommentDao
- Parameters:
containerIds
- the list of comment containers ids- Returns:
- The map of container id and its unresolved comment count
-
setEventPublisher
public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) -
publishEvent
- Overrides:
publishEvent
in classHibernateObjectDao<Comment>
-
scanFilteredComments
- Specified by:
scanFilteredComments
in interfaceCommentDaoInternal
- Parameters:
statuses
- list of content statuspageRequest
- the pagination requested- Returns:
- list of comment entities
-
scanFilteredSpaceComments
public List<Comment> scanFilteredSpaceComments(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest) - Specified by:
scanFilteredSpaceComments
in interfaceCommentDaoInternal
- Parameters:
space
- the space to locate comments instatuses
- list of content statuspageRequest
- the pagination requested- Returns:
- list of comment entities in a given space
-
countSpaceCommentByStatuses
Description copied from interface:CommentDaoInternal
Retrieve the latest content count of specific content type for a given space with a particular status.- Specified by:
countSpaceCommentByStatuses
in interfaceCommentDaoInternal
- Parameters:
space
- the spacecontentStatuses
- the statuses of the content being retrieved (e.g.ContentEntityObject.DELETED
- Returns:
- the number of content objects with that status in that space
-
countCommentByStatuses
Description copied from interface:CommentDaoInternal
Retrieve the latest content count of specific content type for a given space with a particular status.- Specified by:
countCommentByStatuses
in interfaceCommentDaoInternal
- Parameters:
contentStatuses
- the statuses of the content being retrieved (e.g.ContentEntityObject.DELETED
- Returns:
- the number of content objects with that status in that space
-