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 int
countAllCommentVersions()
Count the total number of comments of all types, including previous versionsint
countComments(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 Comment
getByClassId(long id)
Retrieve the object with a particular id from the database.Comment
getById(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 ofEntityObject
this Dao works with.Iterator
getRecentlyUpdatedComments(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:ObjectDaoInternal
Gets the type ofEntityObject
this Dao works with.- Specified by:
getPersistentClass
in interfaceObjectDao
- Specified by:
getPersistentClass
in interfaceObjectDaoInternal<Comment>
- Returns:
- the type
-
getById
public Comment getById(long id)
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
protected Comment getByClassId(long id)
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
public Iterator getRecentlyUpdatedComments(long spaceId, int maxResults)
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
public List<Comment> getContainerComments(long containerId, Date since)
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
public List<Comment> getContainerComments(long containerId, Date since, String ignoreUsername)
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 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: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
public int countComments(Searchable searchable)
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
@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:CommentDao
Get the comments belonging to a container- Specified by:
getContainerComments
in interfaceCommentDao
- Parameters:
containerId
- the container's idpageRequest
- the pagination infodepth
- the search depthpredicates
- the predicates used to filter the children- Returns:
- a
PageResponse
object 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:CommentDao
Get the children of a comment- Specified by:
getChildren
in interfaceCommentDao
- Parameters:
comment
- the parent commentpageRequest
- the pagination infodepth
- the search depthpredicates
- the predicates used to filter the children- Returns:
- the
PageResponse
object that encapsulates the children comments
-
countUnresolvedComments
public Map<Long,Integer> countUnresolvedComments(@NonNull Collection<Long> containerIds)
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
-
-