public class

HibernateLikeDao

extends Object
implements LikeDao
java.lang.Object
   ↳ com.atlassian.confluence.like.HibernateLikeDao

Summary

Public Constructors
HibernateLikeDao(SessionFactory sessionFactory, PermissionManager permissionManager)
Public Methods
void addLike(ContentEntityObject contentEntity)
Add a like for the current logged in user.
Map<LongList<Like>> getLikes(Collection<? extends ContentEntityObject> contentEntities)
Gets all the likes for the specified content entities (likes are ordered such that recent likes come first).
List<Like> getLikes(ContentEntityObject contentEntity)
Gets all the likes for the specified content entity (likes are ordered such that recent likes come first)
boolean hasLike(ContentEntityObject contentEntity)
Returns true if the current logged in user likes this content entity.
void 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)
Rremove like from content entity for the current logged in user.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.like.LikeDao

Public Constructors

public HibernateLikeDao (SessionFactory sessionFactory, PermissionManager permissionManager)

Public Methods

public void addLike (ContentEntityObject contentEntity)

Add a like for the current logged in user.

Parameters
contentEntity the content entity to add a like to

public Map<LongList<Like>> getLikes (Collection<? extends ContentEntityObject> contentEntities)

Gets all the likes for the specified content entities (likes are ordered such that recent likes come first).

Parameters
contentEntities content entities
Returns
  • a map of contentId to a set of all the likes for that piece of content.

public List<Like> getLikes (ContentEntityObject contentEntity)

Gets all the likes for the specified content entity (likes are ordered such that recent likes come first)

Parameters
contentEntity the content entity
Returns
  • all the likes for the specified content entity.

public boolean hasLike (ContentEntityObject contentEntity)

Returns true if the current logged in user likes this content entity.

Parameters
contentEntity the content entity
Returns
  • true if the current logged in user likes this content entity.

public void removeAllLikesFor (String username)

Removes all likes (for any user) from the specified content entity.

Parameters
username the name of the user to remove all likes for

public void removeAllLikesOn (ContentEntityObject contentEntity)

Removes all likes (for any user) from the specified content entity.

Parameters
contentEntity content entity

public void removeLike (ContentEntityObject contentEntity)

Rremove like from content entity for the current logged in user.

Parameters
contentEntity content entity to remove like from