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 Constructor Description HibernateLikeEntityDao(org.hibernate.SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LikeEntityaddLike(ContentEntityObject contentEntity, com.atlassian.user.User user)Add a like on the content entity for the given user.intcountLikes(Searchable searchable)Map<Searchable,Integer>countLikes(Collection<? extends Searchable> searchables)List<LikeEntity>getLikeEntities(Collection<? extends ContentEntityObject> contentEntities)booleanhasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)Returns true if the given user likes this content entity.voidremoveAllLikesFor(@NonNull com.atlassian.sal.api.user.UserKey key)Remove all likes for the given userKeyvoidremoveAllLikesFor(String username)Removes all likes (for any user) from the specified content entity.voidremoveAllLikesOn(ContentEntityObject contentEntity)Removes all likes (for any user) from the specified content entity.voidremoveLike(ContentEntityObject contentEntity, com.atlassian.user.User user)Remove like from content entity for the given user.
-
-
-
Method Detail
-
addLike
public LikeEntity addLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
Description copied from interface:LikeEntityDaoAdd a like on the content entity for the given user.- Specified by:
addLikein interfaceLikeEntityDao- Parameters:
contentEntity- the content entity to add a like touser- User liking the content- Returns:
- the created Like
-
removeLike
public void removeLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
Description copied from interface:LikeEntityDaoRemove like from content entity for the given user.- Specified by:
removeLikein interfaceLikeEntityDao- Parameters:
contentEntity- content entity to remove like fromuser- User removing their Like
-
removeAllLikesOn
public void removeAllLikesOn(ContentEntityObject contentEntity)
Description copied from interface:LikeEntityDaoRemoves all likes (for any user) from the specified content entity.- Specified by:
removeAllLikesOnin interfaceLikeEntityDao- Parameters:
contentEntity- content entity
-
removeAllLikesFor
public void removeAllLikesFor(String username)
Description copied from interface:LikeEntityDaoRemoves all likes (for any user) from the specified content entity.- Specified by:
removeAllLikesForin 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:LikeEntityDaoRemove all likes for the given userKey- Specified by:
removeAllLikesForin interfaceLikeEntityDao
-
hasLike
public boolean hasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
Description copied from interface:LikeEntityDaoReturns true if the given user likes this content entity.- Specified by:
hasLikein interfaceLikeEntityDao- Parameters:
contentEntity- the content entityuser- the User the Like is being checked for- Returns:
- true if the user likes this content entity.
-
getLikeEntities
public List<LikeEntity> getLikeEntities(Collection<? extends ContentEntityObject> contentEntities)
- Specified by:
getLikeEntitiesin interfaceLikeEntityDao
-
countLikes
public int countLikes(Searchable searchable)
- Specified by:
countLikesin interfaceLikeEntityDao
-
countLikes
public Map<Searchable,Integer> countLikes(Collection<? extends Searchable> searchables)
- Specified by:
countLikesin interfaceLikeEntityDao
-
-