Package com.atlassian.confluence.like
Class HibernateLikeEntityDao
java.lang.Object
com.atlassian.confluence.like.HibernateLikeEntityDao
- All Implemented Interfaces:
LikeEntityDao
@ParametersAreNonnullByDefault
public class HibernateLikeEntityDao
extends Object
implements LikeEntityDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLike
(ContentEntityObject contentEntity, com.atlassian.user.User user) Add a like on the content entity for the given user.int
countLikes
(Searchable searchable) countLikes
(Collection<? extends Searchable> searchables) getLikeEntities
(Collection<? extends ContentEntityObject> contentEntities) boolean
hasLike
(ContentEntityObject contentEntity, com.atlassian.user.User user) Returns true if the given user likes this content entity.void
removeAllLikesFor
(@NonNull com.atlassian.sal.api.user.UserKey key) Remove all likes for the given userKeyvoid
removeAllLikesFor
(String username) Removes all likes (for any user) from the specified content entity.void
removeAllLikesOn
(ContentEntityObject contentEntity) Removes all likes (for any user) from the specified content entity.void
removeLike
(ContentEntityObject contentEntity, com.atlassian.user.User user) Remove like from content entity for the given user.
-
Constructor Details
-
HibernateLikeEntityDao
public HibernateLikeEntityDao(org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
addLike
Description copied from interface:LikeEntityDao
Add a like on the content entity for the given user.- Specified by:
addLike
in interfaceLikeEntityDao
- Parameters:
contentEntity
- the content entity to add a like touser
- User liking the content- Returns:
- the created Like
-
removeLike
Description copied from interface:LikeEntityDao
Remove like from content entity for the given user.- Specified by:
removeLike
in interfaceLikeEntityDao
- Parameters:
contentEntity
- content entity to remove like fromuser
- User removing their Like
-
removeAllLikesOn
Description copied from interface:LikeEntityDao
Removes all likes (for any user) from the specified content entity.- Specified by:
removeAllLikesOn
in interfaceLikeEntityDao
- Parameters:
contentEntity
- content entity
-
removeAllLikesFor
Description copied from interface:LikeEntityDao
Removes all likes (for any user) from the specified content entity.- Specified by:
removeAllLikesFor
in interfaceLikeEntityDao
- 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 interfaceLikeEntityDao
-
hasLike
Description copied from interface:LikeEntityDao
Returns true if the given user likes this content entity.- Specified by:
hasLike
in interfaceLikeEntityDao
- Parameters:
contentEntity
- the content entityuser
- the User the Like is being checked for- Returns:
- true if the user likes this content entity.
-
getLikeEntities
- Specified by:
getLikeEntities
in interfaceLikeEntityDao
-
countLikes
- Specified by:
countLikes
in interfaceLikeEntityDao
-
countLikes
- Specified by:
countLikes
in interfaceLikeEntityDao
-