com.atlassian.crowd.model.group
Class GroupDAOHibernate

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by com.atlassian.crowd.util.persistence.hibernate.HibernateDao
              extended by com.atlassian.crowd.model.group.GroupDAOHibernate
All Implemented Interfaces:
GroupDAO, ObjectDao, org.springframework.beans.factory.InitializingBean

public class GroupDAOHibernate
extends HibernateDao
implements GroupDAO


Field Summary
 
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
batchProcessor, logger
 
Constructor Summary
GroupDAOHibernate()
           
 
Method Summary
 InternalGroup add(Group group)
           
 BatchResultWithIdReferences<Group> addAll(Collection<InternalGroupWithAttributes> groups)
           
 BatchResult<Group> addAll(long directoryId, Set<GroupTemplate> groups)
          Bulk add of users using JDBC batch support.
 InternalGroup findByName(long directoryID, String groupName)
           
 Collection<InternalGroup> findByNames(long directoryID, Collection<String> groupnames)
          Bulk find of groups using SQL disjunction.
 InternalGroupWithAttributes findByNameWithAttributes(long directoryID, String groupName)
           
 List<InternalGroupAttribute> findGroupAttributes(long groupId)
           
 Class getPersistentClass()
          All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to work correctly
 void remove(Group group)
           
 void removeAll(long directoryId)
           
 void removeAttribute(Group group, String attributeName)
           
 InternalGroup rename(Group group, String newName)
           
 List search(long directoryID, EntityQuery query)
           
 void setDirectoryDAO(DirectoryDAO directoryDAO)
           
 void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
           
 void setInternalAttributesHelper(InternalAttributesHelper internalAttributesHelper)
           
 void setMembershipDAO(MembershipDAO membershipDAO)
           
 void storeAttributes(Group group, Map<String,List<String>> attributes)
           
 InternalGroup update(Group group)
           
 
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
load, loadReference, remove, save, saveOrUpdate, setBatchProcessor, update
 
Methods inherited from class org.springframework.orm.hibernate3.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
 
Methods inherited from interface com.atlassian.crowd.util.persistence.hibernate.ObjectDao
load, remove, save, update
 

Constructor Detail

GroupDAOHibernate

public GroupDAOHibernate()
Method Detail

getPersistentClass

public Class getPersistentClass()
Description copied from class: HibernateDao
All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to work correctly

Specified by:
getPersistentClass in interface ObjectDao
Specified by:
getPersistentClass in class HibernateDao
Returns:
Class

findByName

public InternalGroup findByName(long directoryID,
                                String groupName)
                         throws ObjectNotFoundException
Specified by:
findByName in interface GroupDAO
Throws:
ObjectNotFoundException

findByNameWithAttributes

public InternalGroupWithAttributes findByNameWithAttributes(long directoryID,
                                                            String groupName)
                                                     throws ObjectNotFoundException
Specified by:
findByNameWithAttributes in interface GroupDAO
Throws:
ObjectNotFoundException

findGroupAttributes

public List<InternalGroupAttribute> findGroupAttributes(long groupId)

add

public InternalGroup add(Group group)
                  throws ObjectNotFoundException
Specified by:
add in interface GroupDAO
Throws:
ObjectNotFoundException

update

public InternalGroup update(Group group)
                     throws ObjectNotFoundException
Specified by:
update in interface GroupDAO
Throws:
ObjectNotFoundException

rename

public InternalGroup rename(Group group,
                            String newName)
                     throws ObjectNotFoundException
Specified by:
rename in interface GroupDAO
Throws:
ObjectNotFoundException

storeAttributes

public void storeAttributes(Group group,
                            Map<String,List<String>> attributes)
                     throws ObjectNotFoundException
Specified by:
storeAttributes in interface GroupDAO
Throws:
ObjectNotFoundException

removeAttribute

public void removeAttribute(Group group,
                            String attributeName)
                     throws ObjectNotFoundException
Specified by:
removeAttribute in interface GroupDAO
Throws:
ObjectNotFoundException

remove

public void remove(Group group)
            throws ObjectNotFoundException
Specified by:
remove in interface GroupDAO
Throws:
ObjectNotFoundException

removeAll

public void removeAll(long directoryId)
Specified by:
removeAll in interface GroupDAO

search

public List search(long directoryID,
                   EntityQuery query)
Specified by:
search in interface GroupDAO
Parameters:
directoryID - ID of the directory to condunct the search.
query - the group query
Returns:
a List of groups, or an empty list.

addAll

public BatchResult<Group> addAll(long directoryId,
                                 Set<GroupTemplate> groups)
                          throws ObjectNotFoundException
Description copied from interface: GroupDAO
Bulk add of users using JDBC batch support.

Specified by:
addAll in interface GroupDAO
Parameters:
directoryId - the directory to add the groups to
groups - to be added
Returns:
a list of Groups that failed to be added
Throws:
ObjectNotFoundException - if the directory cannot be found

addAll

public BatchResultWithIdReferences<Group> addAll(Collection<InternalGroupWithAttributes> groups)

findByNames

public Collection<InternalGroup> findByNames(long directoryID,
                                             Collection<String> groupnames)
Description copied from interface: GroupDAO
Bulk find of groups using SQL disjunction.

Specified by:
findByNames in interface GroupDAO
Parameters:
directoryID - the directory to search for the groups.
groupnames - names of groups to find
Returns:
collection of found groups.

setDirectoryDAO

public void setDirectoryDAO(DirectoryDAO directoryDAO)

setMembershipDAO

public void setMembershipDAO(MembershipDAO membershipDAO)

setHqlQueryTranslater

public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)

setInternalAttributesHelper

public void setInternalAttributesHelper(InternalAttributesHelper internalAttributesHelper)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.