Class HibernateCommentDao

    • Constructor Detail

      • HibernateCommentDao

        public HibernateCommentDao()
    • Method Detail

      • getById

        public Comment getById​(long id)
        Description copied from interface: CommentDao
        Get a comment by its id
        Specified by:
        getById in interface CommentDao
        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 class HibernateObjectDao<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 interface CommentDao
        Parameters:
        spaceId - the space's id
        maxResults - 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 interface CommentDao
        Parameters:
        containerId - the container's id
        since - 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 interface CommentDao
        Parameters:
        containerId - the container's id
        since - Date the time after which the comments have been added or updated
        ignoreUsername - the user to be ignored
        Returns:
        a list of comments created or updated
      • countComments

        public int countComments​(Searchable searchable)
        Description copied from interface: CommentDao
        Count all comments in a searchable content
        Specified by:
        countComments in interface CommentDao
        Parameters:
        searchable - a Searchable 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 interface CommentDao
        Returns:
        the total number of 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 interface CommentDao
        Parameters:
        containerIds - the list of comment containers ids
        Returns:
        The map of container id and its unresolved comment count