Class HibernateLikeEntityDao

    • Constructor Detail

      • HibernateLikeEntityDao

        public HibernateLikeEntityDao​(org.hibernate.SessionFactory sessionFactory)
    • Method Detail

      • addLike

        public LikeEntity addLike​(ContentEntityObject contentEntity,
                                  com.atlassian.user.User user)
        Description copied from interface: LikeEntityDao
        Add a like on the content entity for the given user.
        Specified by:
        addLike in interface LikeEntityDao
        Parameters:
        contentEntity - the content entity to add a like to
        user - User liking the content
        Returns:
        the created Like
      • removeLike

        public void removeLike​(ContentEntityObject contentEntity,
                               com.atlassian.user.User user)
        Description copied from interface: LikeEntityDao
        Remove like from content entity for the given user.
        Specified by:
        removeLike in interface LikeEntityDao
        Parameters:
        contentEntity - content entity to remove like from
        user - User removing their Like
      • removeAllLikesOn

        public void removeAllLikesOn​(ContentEntityObject contentEntity)
        Description copied from interface: LikeEntityDao
        Removes all likes (for any user) from the specified content entity.
        Specified by:
        removeAllLikesOn in interface LikeEntityDao
        Parameters:
        contentEntity - content entity
      • removeAllLikesFor

        public void removeAllLikesFor​(String username)
        Description copied from interface: LikeEntityDao
        Removes all likes (for any user) from the specified content entity.
        Specified by:
        removeAllLikesFor in interface LikeEntityDao
        Parameters:
        username - the name of the user to remove all likes for
      • removeAllLikesFor

        public void removeAllLikesFor​(@NonNull com.atlassian.sal.api.user.UserKey key)
        Description copied from interface: LikeEntityDao
        Remove all likes for the given userKey
        Specified by:
        removeAllLikesFor in interface LikeEntityDao
      • hasLike

        public boolean hasLike​(ContentEntityObject contentEntity,
                               com.atlassian.user.User user)
        Description copied from interface: LikeEntityDao
        Returns true if the given user likes this content entity.
        Specified by:
        hasLike in interface LikeEntityDao
        Parameters:
        contentEntity - the content entity
        user - the User the Like is being checked for
        Returns:
        true if the user likes this content entity.