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

Hibernate implementation of the GroupDAO interface.


Field Summary
 
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
batchProcessor
 
Constructor Summary
GroupDAOHibernate()
           
 
Method Summary
 RemoteGroup add(RemoteGroup group)
          Adds the RemoteGroup to the datastore.
 BatchResult<RemoteGroup> addAll(java.util.Set<RemoteGroup> groups)
          Adds a collection of RemoteGroup to the datastore.
 RemoteGroup findByName(long directoryID, java.lang.String name)
          Finds the RemoteGroup based on the passed in group name.
 java.util.Collection<RemoteGroup> findByNames(long directoryID, java.util.Collection<java.lang.String> names)
          Finds a collection of RemoteGroup by searching the directoryID and name primary keys.
 java.lang.Class getPersistentClass()
          All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to work correctly
 void remove(RemoteGroup group)
          Removes a RemoteGroup from the datastore.
 java.util.List<RemoteGroup> search(SearchContext searchContext)
          Performs a search for RemoteGroups based on a given SearchContext.
 RemoteGroup update(RemoteGroup group)
          Updates an RemoteGroup in the datastore.
 
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
load, 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

add

public RemoteGroup add(RemoteGroup group)
Description copied from interface: GroupDAO
Adds the RemoteGroup to the datastore.

Specified by:
add in interface GroupDAO
Parameters:
group - The group to persist.
Returns:
The persisted group.
See Also:
GroupDAO.add(RemoteGroup)

addAll

public BatchResult<RemoteGroup> addAll(java.util.Set<RemoteGroup> groups)
Description copied from interface: GroupDAO
Adds a collection of RemoteGroup to the datastore. This will attempt to batch process as much of the set as possible. If some groups fail, it will still commit the groups that are successfully added. If a group exists, it will be updated with the new group data (ie. overwrite).

Specified by:
addAll in interface GroupDAO
Parameters:
groups - The groups to persist.
Returns:
groups that failed to be added.

findByNames

public java.util.Collection<RemoteGroup> findByNames(long directoryID,
                                                     java.util.Collection<java.lang.String> names)
                                              throws org.springframework.dao.DataAccessException
Description copied from interface: GroupDAO
Finds a collection of RemoteGroup by searching the directoryID and name primary keys.

Specified by:
findByNames in interface GroupDAO
Parameters:
directoryID - directory ID to restrict search to.
names - names to find.
Returns:
all the groups matching the search criteria.
Throws:
org.springframework.dao.DataAccessException - generic persistence exception.

findByName

public RemoteGroup findByName(long directoryID,
                              java.lang.String name)
                       throws ObjectNotFoundException
Description copied from interface: GroupDAO
Finds the RemoteGroup based on the passed in group name.

Specified by:
findByName in interface GroupDAO
Parameters:
directoryID - the id of the Directory you are searching
name - The name of the group to find.
Returns:
The RemoteGroup from the datastore.
Throws:
ObjectNotFoundException - If the RemoteGroup based on the passed in name is not found.
See Also:
GroupDAO.findByName(long,String)

search

public java.util.List<RemoteGroup> search(SearchContext searchContext)
                                   throws InvalidSearchTermException
Description copied from interface: GroupDAO
Performs a search for RemoteGroups based on a given SearchContext.

Specified by:
search in interface GroupDAO
Parameters:
searchContext - The search context to find a given list of group.
Returns:
A List of RemoteGroups found from the SearchContext.
Throws:
InvalidSearchTermException - If there are no search terms provided
See Also:
GroupDAO.search(SearchContext)

update

public RemoteGroup update(RemoteGroup group)
Description copied from interface: GroupDAO
Updates an RemoteGroup in the datastore.

Specified by:
update in interface GroupDAO
Parameters:
group - The group to update.
Returns:
The updated RemoteGroup.
See Also:
GroupDAO.update(RemoteGroup)

remove

public void remove(RemoteGroup group)
Description copied from interface: GroupDAO
Removes a RemoteGroup from the datastore.

Specified by:
remove in interface GroupDAO
Parameters:
group - The group to remove.
See Also:
GroupDAO.remove(RemoteGroup)

getPersistentClass

public java.lang.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
See Also:
ObjectDao.getPersistentClass()


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.