Class HibernateLikeEntityDao
java.lang.Object
com.atlassian.confluence.impl.like.HibernateLikeEntityDao
- All Implemented Interfaces:
LikeEntityDao
@ParametersAreNonnullByDefault
public class HibernateLikeEntityDao
extends Object
implements LikeEntityDao
-
Constructor Summary
ConstructorsConstructorDescriptionHibernateLikeEntityDao
(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionaddLike
(ContentEntityObject contentEntity, ConfluenceUser 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, ConfluenceUser user) Returns true if the given user likes this content entity.void
removeAllLikesFor
(@NonNull ConfluenceUser user) Remove all likes for the given uservoid
removeAllLikesOn
(ContentEntityObject contentEntity) Removes all likes (for any user) from the specified content entity.void
removeLike
(ContentEntityObject contentEntity, ConfluenceUser user) Remove like from content entity for the given user.
-
Constructor Details
-
HibernateLikeEntityDao
public HibernateLikeEntityDao(org.hibernate.engine.spi.SessionFactoryImplementor 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
Remove all likes for the given user- 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
-