com.atlassian.crowd.model.principal
Class UserDAOHibernate
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
com.atlassian.crowd.util.persistence.hibernate.HibernateDao
com.atlassian.crowd.model.principal.UserDAOHibernate
- All Implemented Interfaces:
- UserDAO, ObjectDao, org.springframework.beans.factory.InitializingBean
public class UserDAOHibernate
- extends HibernateDao
- implements UserDAO
|
Method Summary |
InternalUser |
add(User user,
PasswordCredential credential)
|
BatchResult<User> |
addAll(long directoryId,
java.util.Set<UserTemplateWithCredentialAndAttributes> users)
Bulk add of users using JDBC batch support. |
InternalUser |
findByName(long directoryID,
java.lang.String username)
|
java.util.Collection<InternalUser> |
findByNames(long directoryID,
java.util.Collection<java.lang.String> usernames)
Bulk find of users using SQL disjunction. |
InternalUserWithAttributes |
findByNameWithAttributes(long directoryID,
java.lang.String username)
|
java.util.List<InternalUserAttribute> |
findUserAttributes(long userID)
|
java.lang.Class |
getPersistentClass()
All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to
work correctly |
void |
remove(User user)
|
void |
removeAll(long directoryId)
|
void |
removeAttribute(User user,
java.lang.String attributeName)
|
InternalUser |
rename(User user,
java.lang.String newUsername)
|
java.util.List |
search(long directoryID,
EntityQuery query)
|
void |
setDirectoryDAO(DirectoryDAO directoryDAO)
|
void |
setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
|
void |
setInternalAttributesHelper(InternalAttributesHelper internalAttributesHelper)
|
void |
setMembershipDAO(MembershipDAO membershipDAO)
|
void |
storeAttributes(User user,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)
|
InternalUser |
update(User user)
|
InternalUser |
updateCredential(User user,
PasswordCredential credential,
int maxPasswordHistory)
|
| 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 |
UserDAOHibernate
public UserDAOHibernate()
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
findByName
public InternalUser findByName(long directoryID,
java.lang.String username)
throws ObjectNotFoundException
- Specified by:
findByName in interface UserDAO
- Throws:
ObjectNotFoundException
findByNameWithAttributes
public InternalUserWithAttributes findByNameWithAttributes(long directoryID,
java.lang.String username)
throws ObjectNotFoundException
- Specified by:
findByNameWithAttributes in interface UserDAO
- Throws:
ObjectNotFoundException
findUserAttributes
public java.util.List<InternalUserAttribute> findUserAttributes(long userID)
add
public InternalUser add(User user,
PasswordCredential credential)
throws ObjectNotFoundException
- Specified by:
add in interface UserDAO
- Throws:
ObjectNotFoundException
update
public InternalUser update(User user)
throws ObjectNotFoundException
- Specified by:
update in interface UserDAO
- Throws:
ObjectNotFoundException
updateCredential
public InternalUser updateCredential(User user,
PasswordCredential credential,
int maxPasswordHistory)
throws ObjectNotFoundException
- Specified by:
updateCredential in interface UserDAO
- Throws:
ObjectNotFoundException
rename
public InternalUser rename(User user,
java.lang.String newUsername)
throws ObjectNotFoundException
- Specified by:
rename in interface UserDAO
- Throws:
ObjectNotFoundException
remove
public void remove(User user)
throws ObjectNotFoundException
- Specified by:
remove in interface UserDAO
- Throws:
ObjectNotFoundException
removeAll
public void removeAll(long directoryId)
- Specified by:
removeAll in interface UserDAO
storeAttributes
public void storeAttributes(User user,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)
throws ObjectNotFoundException
- Specified by:
storeAttributes in interface UserDAO
- Throws:
ObjectNotFoundException
removeAttribute
public void removeAttribute(User user,
java.lang.String attributeName)
throws ObjectNotFoundException
- Specified by:
removeAttribute in interface UserDAO
- Throws:
ObjectNotFoundException
search
public java.util.List search(long directoryID,
EntityQuery query)
- Specified by:
search in interface UserDAO
- Parameters:
directoryID - ID of the directory to condunct the search.query - the user query
- Returns:
- a List of users, or an empty list.
addAll
public BatchResult<User> addAll(long directoryId,
java.util.Set<UserTemplateWithCredentialAndAttributes> users)
throws ObjectNotFoundException
- Description copied from interface:
UserDAO
- Bulk add of users using JDBC batch support.
- Specified by:
addAll in interface UserDAO
- Parameters:
directoryId - the directory to add the users tousers - to be added
- Returns:
- a list of Users that failed to be added
- Throws:
ObjectNotFoundException - if the directory cannot be found
findByNames
public java.util.Collection<InternalUser> findByNames(long directoryID,
java.util.Collection<java.lang.String> usernames)
- Description copied from interface:
UserDAO
- Bulk find of users using SQL disjunction.
- Specified by:
findByNames in interface UserDAO
- Parameters:
directoryID - the directory to search for the users.usernames - names of users to find
- Returns:
- collection of found users.
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.