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 TypeMethodDescriptionintCount the total number of comments of all types, including previous versionslongcountCommentByStatuses(List<ContentStatus> contentStatuses) Retrieve the latest content count of specific content type for a given space with a particular status.intcountComments(Searchable searchable) Count all comments in a searchable contentcountComments(Collection<? extends Searchable> searchables) Count all comments for each content in a collectionlongcountSpaceCommentByStatuses(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 CommentgetByClassId(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 voidscanFilteredComments(List<ContentStatus> statuses, LimitedRequest pageRequest) scanFilteredSpaceComments(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest) voidsetEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
applyChildVersioningPolicy, findAllSorted, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, remove, saveMethods inherited from class com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao
findNamedQueryStringParams, getContentStatusStringList, getStatusNames, scanFilteredContents, scanFilteredContents, updateModificationDataMethods 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, uniqueResultMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDaoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.internal.pages.persistence.CommentDaoInternal
save 
- 
Constructor Details
- 
HibernateCommentDao
public HibernateCommentDao() 
 - 
 - 
Method Details
- 
getPersistentClass
- Specified by:
 getPersistentClassin classHibernateObjectDao<Comment>
 - 
getById
Description copied from interface:CommentDaoGet a comment by its id- Specified by:
 getByIdin interfaceCommentDao- Parameters:
 id- the comment's id- Returns:
 - the comment object
 
 - 
getByClassId
Description copied from class:HibernateObjectDaoRetrieve 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:
 getByClassIdin 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:CommentDaoGet all comments that have been updated recently in a space- Specified by:
 getRecentlyUpdatedCommentsin interfaceCommentDao- Parameters:
 spaceId- the space's idmaxResults- the maximum number of comments that can be retrieved- Returns:
 - a 
Iteratorobject that encapsulates the list of comments found 
 - 
getContainerComments
Description copied from interface:CommentDaoGet the comments that have been added or updated since a specific time- Specified by:
 getContainerCommentsin interfaceCommentDao- Parameters:
 containerId- the container's idsince-Datethe time after which the comments have been added or updated- Returns:
 - a list of comments created or updated
 
 - 
getContainerComments
Description copied from interface:CommentDaoGet the comments that have been added or updated since a specific time but not by a user- Specified by:
 getContainerCommentsin interfaceCommentDao- Parameters:
 containerId- the container's idsince-Datethe 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:CommentDaoCount all comments for each content in a collection- Specified by:
 countCommentsin interfaceCommentDao- Parameters:
 searchables- a collection ofSearchableobjects representing the contents- Returns:
 - a map of counts for each searchable content
 
 - 
countComments
Description copied from interface:CommentDaoCount all comments in a searchable content- Specified by:
 countCommentsin interfaceCommentDao- Parameters:
 searchable- aSearchableobject representing the content- Returns:
 - a number of comments in the searchable content
 
 - 
countAllCommentVersions
public int countAllCommentVersions()Description copied from interface:CommentDaoCount the total number of comments of all types, including previous versions- Specified by:
 countAllCommentVersionsin interfaceCommentDao- Returns:
 - the total number of comments
 
 - 
getContainerComments
- Specified by:
 getContainerCommentsin interfaceCommentDao
 - 
getChildren
- Specified by:
 getChildrenin interfaceCommentDao
 - 
countUnresolvedComments
Description copied from interface:CommentDaoCount unresolved comments of comment containers.- Specified by:
 countUnresolvedCommentsin 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:
 publishEventin classHibernateObjectDao<Comment>
 - 
scanFilteredComments
- Specified by:
 scanFilteredCommentsin 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:
 scanFilteredSpaceCommentsin 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:CommentDaoInternalRetrieve the latest content count of specific content type for a given space with a particular status.- Specified by:
 countSpaceCommentByStatusesin 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:CommentDaoInternalRetrieve the latest content count of specific content type for a given space with a particular status.- Specified by:
 countCommentByStatusesin 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
 
 
 -