Class HibernateRatingDAO

    • Constructor Detail

      • HibernateRatingDAO

        public HibernateRatingDAO()
    • Method Detail

      • findVotesByDocId

        public Rating findVotesByDocId​(long docId)
        Description copied from interface: RatingDAO
        Returns a rating that contains count and average of vote on the given document
        Specified by:
        findVotesByDocId in interface RatingDAO
        Parameters:
        docId - ID of the document
        Returns:
        the rating for the document
      • findByDocIdAndUserId

        public Rating findByDocIdAndUserId​(long docId,
                                           long userId)
        Description copied from interface: RatingDAO
        Finds the rating for the given user id and the given document id
        Specified by:
        findByDocIdAndUserId in interface RatingDAO
        Parameters:
        docId - ID of the document
        userId - ID of the user
        Returns:
        the vote of the given user on the document
      • findByDocId

        public List<Rating> findByDocId​(long docId)
        Description copied from interface: RatingDAO
        Finds the ratings stored for the given document id
        Specified by:
        findByDocId in interface RatingDAO
        Parameters:
        docId - ID of the document
        Returns:
        the list of ratings