com.atlassian.confluence.like
Class HibernateLikeEntityDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.confluence.like.HibernateLikeEntityDao
All Implemented Interfaces:
ObjectDao, LikeEntityDao, org.springframework.beans.factory.InitializingBean

public class HibernateLikeEntityDao
extends HibernateObjectDao
implements LikeEntityDao


Field Summary
 
Fields inherited from class com.atlassian.hibernate.HibernateObjectDao
log
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateLikeEntityDao(net.sf.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
 LikeEntity addLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
          Add a like on the content entity for the given user.
 java.util.Map<com.atlassian.bonnie.Searchable,java.lang.Integer> countLikes(java.util.Collection<? extends com.atlassian.bonnie.Searchable> searchables)
           
 int countLikes(com.atlassian.bonnie.Searchable searchable)
           
 java.util.List<LikeEntity> getLikeEntities(java.util.Collection<? extends ContentEntityObject> contentEntities)
           
 java.lang.Class getPersistentClass()
           
 boolean hasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
          Returns true if the given user likes this content entity.
 void removeAllLikesFor(java.lang.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.
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex, uniqueResult, updateModificationData
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateLikeEntityDao

public HibernateLikeEntityDao(net.sf.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(java.lang.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

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.

getLikeEntities

public java.util.List<LikeEntity> getLikeEntities(@NotNull
                                                  java.util.Collection<? extends ContentEntityObject> contentEntities)
Specified by:
getLikeEntities in interface LikeEntityDao

countLikes

public int countLikes(com.atlassian.bonnie.Searchable searchable)
Specified by:
countLikes in interface LikeEntityDao

countLikes

public java.util.Map<com.atlassian.bonnie.Searchable,java.lang.Integer> countLikes(java.util.Collection<? extends com.atlassian.bonnie.Searchable> searchables)
Specified by:
countLikes in interface LikeEntityDao

getPersistentClass

public java.lang.Class getPersistentClass()
Specified by:
getPersistentClass in interface ObjectDao


Copyright © 2003-2014 Atlassian. All Rights Reserved.