com.atlassian.crowd.dao.directory
Class DirectoryDAOHibernate

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.dao.directory.DirectoryDAOHibernate
All Implemented Interfaces:
DirectoryDao, org.springframework.beans.factory.InitializingBean

public class DirectoryDAOHibernate
extends HibernateDao
implements DirectoryDao


Field Summary
 
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
batchFinder, batchProcessor, logger
 
Constructor Summary
DirectoryDAOHibernate()
           
 
Method Summary
 DirectoryImpl add(Directory directory)
          Store a new directory in the data store.
 java.util.List<Directory> findAll()
          Returns the list of all directories in the data store, or empty list if there are no directories.
 DirectoryImpl findById(long id)
          Returns the directory with the specified ID, throwing DirectoryNotFoundException if it cannot be found.
 DirectoryImpl findByName(java.lang.String name)
          Returns the directory with the specified name, throwing DirectoryNotFoundException if it cannot be found.
 java.lang.Class getPersistentClass()
          All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to work correctly
 void remove(Directory directory)
          Removes the specified directory from the data store.
 java.util.List<Directory> search(EntityQuery query)
          Search for directories matching the specified query.
 void setGroupDAO(InternalGroupDao internalGroupDao)
           
 void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
           
 void setUserDAO(InternalUserDao internalUserDao)
           
 DirectoryImpl update(Directory directory)
          Persists any changes made to the provided directory.
 
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
load, loadReference, remove, save, saveOrUpdate, setBatchFinder, 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
 

Constructor Detail

DirectoryDAOHibernate

public DirectoryDAOHibernate()
Method Detail

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 class HibernateDao
Returns:
Class

findById

public DirectoryImpl findById(long id)
                       throws DirectoryNotFoundException
Description copied from interface: DirectoryDao
Returns the directory with the specified ID, throwing DirectoryNotFoundException if it cannot be found.

Specified by:
findById in interface DirectoryDao
Parameters:
id - the ID of the directory to find
Returns:
the directory with the specified ID
Throws:
DirectoryNotFoundException - if there is no directory with the specified ID

findByName

public DirectoryImpl findByName(java.lang.String name)
                         throws DirectoryNotFoundException
Description copied from interface: DirectoryDao
Returns the directory with the specified name, throwing DirectoryNotFoundException if it cannot be found.

Specified by:
findByName in interface DirectoryDao
Parameters:
name - the name of the directory to find
Returns:
the directory with the specified name
Throws:
DirectoryNotFoundException - if there is no directory with the specified name

findAll

public java.util.List<Directory> findAll()
Description copied from interface: DirectoryDao
Returns the list of all directories in the data store, or empty list if there are no directories.

Specified by:
findAll in interface DirectoryDao

add

public DirectoryImpl add(Directory directory)
Description copied from interface: DirectoryDao
Store a new directory in the data store.

Specified by:
add in interface DirectoryDao
Parameters:
directory - the directory to persist
Returns:
the newly-persisted directory, which should be used for subsequent operations

update

public DirectoryImpl update(Directory directory)
                     throws DirectoryNotFoundException
Description copied from interface: DirectoryDao
Persists any changes made to the provided directory.

Specified by:
update in interface DirectoryDao
Parameters:
directory - the directory which has changes to persist
Returns:
the updated directory after it has been persisted, which should be used for subsequent operations
Throws:
DirectoryNotFoundException - if the directory is not found in the data store

remove

public void remove(Directory directory)
            throws DirectoryNotFoundException
Description copied from interface: DirectoryDao
Removes the specified directory from the data store.

Specified by:
remove in interface DirectoryDao
Parameters:
directory - the directory to remove
Throws:
DirectoryNotFoundException - if the directory does not exist

search

public java.util.List<Directory> search(EntityQuery query)
Description copied from interface: DirectoryDao
Search for directories matching the specified query.

Specified by:
search in interface DirectoryDao
Parameters:
query - the search query to run against the directory data store
Returns:
a list of directories matching the query
See Also:
QueryBuilder.queryFor(java.lang.Class, com.atlassian.crowd.search.EntityDescriptor)

setUserDAO

public void setUserDAO(InternalUserDao internalUserDao)

setGroupDAO

public void setGroupDAO(InternalGroupDao internalGroupDao)

setHqlQueryTranslater

public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)


Copyright © 2010 Atlassian. All Rights Reserved.