Class HibernateCommentDao
- 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.core.persistence.hibernate.ConfluenceHibernateObjectDao<Comment>
-
- com.atlassian.confluence.pages.persistence.dao.hibernate.HibernateCommentDao
-
- All Implemented Interfaces:
ObjectDao,VersionedObjectDao<Comment>,CommentDaoInternal,ObjectDaoInternal<Comment>,VersionedObjectDaoInternal<Comment>,CommentDao,org.springframework.beans.factory.InitializingBean
public class HibernateCommentDao extends ConfluenceHibernateObjectDao<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 com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory, confluenceUserDao
-
-
Constructor Summary
Constructors Constructor Description HibernateCommentDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcountAllCommentVersions()Count the total number of comments of all types, including previous versionsintcountComments(Searchable searchable)Count all comments in a searchable contentMap<Searchable,Integer>countComments(Collection<? extends Searchable> searchables)Count all comments for each content in a collectionMap<Long,Integer>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.CommentgetById(long id)Get a comment by its idPageResponse<Comment>getChildren(Comment comment, LimitedRequest pageRequest, Depth depth, com.google.common.base.Predicate<? super Comment>... predicates)Deprecated.since 7.0.1.PageResponse<Comment>getContainerComments(long containerId, LimitedRequest pageRequest, Depth depth, com.google.common.base.Predicate<? super Comment>... predicates)Deprecated.since 7.0.1.List<Comment>getContainerComments(long containerId, Date since)Get the comments that have been added or updated since a specific timeList<Comment>getContainerComments(long containerId, Date since, String ignoreUsername)Get the comments that have been added or updated since a specific time but not by a userClass<Comment>getPersistentClass()Gets the type ofEntityObjectthis Dao works with.IteratorgetRecentlyUpdatedComments(long spaceId, int maxResults)Get all comments that have been updated recently in a space-
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.internal.pages.persistence.CommentDaoInternal
getFilteredChildren, getFilteredContainerComments
-
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
-
-
-
-
Method Detail
-
getPersistentClass
public Class<Comment> getPersistentClass()
Description copied from interface:ObjectDaoInternalGets the type ofEntityObjectthis Dao works with.- Specified by:
getPersistentClassin interfaceObjectDao- Specified by:
getPersistentClassin interfaceObjectDaoInternal<Comment>- Returns:
- the type
-
getById
public Comment getById(long id)
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
protected Comment getByClassId(long id)
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
public Iterator getRecentlyUpdatedComments(long spaceId, int maxResults)
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
public List<Comment> getContainerComments(long containerId, Date since)
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
public List<Comment> getContainerComments(long containerId, Date since, String ignoreUsername)
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 updatedignoreUsername- the user to be ignored- Returns:
- a list of comments created or updated
-
countComments
public Map<Searchable,Integer> countComments(Collection<? extends Searchable> searchables)
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
public int countComments(Searchable searchable)
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
@Deprecated public PageResponse<Comment> getContainerComments(long containerId, LimitedRequest pageRequest, Depth depth, com.google.common.base.Predicate<? super Comment>... predicates)
Deprecated.since 7.0.1. UseCommentDaoInternal.getFilteredContainerComments(long, LimitedRequest, Depth, java.util.function.Predicate[])(long, Date)}Description copied from interface:CommentDaoGet the comments belonging to a container- Specified by:
getContainerCommentsin interfaceCommentDao- Parameters:
containerId- the container's idpageRequest- the pagination infodepth- the search depthpredicates- the predicates used to filter the children- Returns:
- a
PageResponseobject that encapsulates the comments
-
getChildren
@Deprecated public PageResponse<Comment> getChildren(Comment comment, LimitedRequest pageRequest, Depth depth, com.google.common.base.Predicate<? super Comment>... predicates)
Deprecated.Description copied from interface:CommentDaoGet the children of a comment- Specified by:
getChildrenin interfaceCommentDao- Parameters:
comment- the parent commentpageRequest- the pagination infodepth- the search depthpredicates- the predicates used to filter the children- Returns:
- the
PageResponseobject that encapsulates the children comments
-
countUnresolvedComments
public Map<Long,Integer> countUnresolvedComments(@NonNull Collection<Long> containerIds)
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
-
-