org.appfuse.dao.hibernate
Class UserDaoHibernate

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.appfuse.dao.hibernate.BaseDaoHibernate
              extended by org.appfuse.dao.hibernate.UserDaoHibernate
All Implemented Interfaces:
org.acegisecurity.userdetails.UserDetailsService, Dao, UserDao, InitializingBean

public class UserDaoHibernate
extends BaseDaoHibernate
implements UserDao, org.acegisecurity.userdetails.UserDetailsService

This class interacts with Spring's HibernateTemplate to save/delete and retrieve User objects.

View Source

Author:
Matt Raible Modified by Dan Kibler Extended to implement Acegi UserDetailsService interface by David Carter [email protected]

Field Summary
 
Fields inherited from class org.appfuse.dao.hibernate.BaseDaoHibernate
log
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
UserDaoHibernate()
           
 
Method Summary
 User getUser(Long userId)
          Gets users information based on user id.
 List getUsers(User user)
          Gets a list of users based on parameters passed in.
 org.acegisecurity.userdetails.UserDetails loadUserByUsername(String username)
          Gets users information based on login name.
 void removeUser(Long userId)
          Removes a user from the database by id
 void saveUser(User user)
          Saves a user's information
 
Methods inherited from class org.appfuse.dao.hibernate.BaseDaoHibernate
getObject, getObjects, removeObject, saveObject
 
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 org.appfuse.dao.Dao
getObject, getObjects, removeObject, saveObject
 

Constructor Detail

UserDaoHibernate

public UserDaoHibernate()
Method Detail

getUser

public User getUser(Long userId)
Description copied from interface: UserDao
Gets users information based on user id.

Specified by:
getUser in interface UserDao
Parameters:
userId - the user's id
Returns:
user populated user object
See Also:
UserDao.getUser(Long)

getUsers

public List getUsers(User user)
Description copied from interface: UserDao
Gets a list of users based on parameters passed in.

Specified by:
getUsers in interface UserDao
Returns:
List populated list of users
See Also:
UserDao.getUsers(org.appfuse.model.User)

saveUser

public void saveUser(User user)
Description copied from interface: UserDao
Saves a user's information

Specified by:
saveUser in interface UserDao
Parameters:
user - the object to be saved
See Also:
UserDao.saveUser(org.appfuse.model.User)

removeUser

public void removeUser(Long userId)
Description copied from interface: UserDao
Removes a user from the database by id

Specified by:
removeUser in interface UserDao
Parameters:
userId - the user's id
See Also:
UserDao.removeUser(Long)

loadUserByUsername

public org.acegisecurity.userdetails.UserDetails loadUserByUsername(String username)
                                                             throws org.acegisecurity.userdetails.UsernameNotFoundException
Description copied from interface: UserDao
Gets users information based on login name.

Specified by:
loadUserByUsername in interface org.acegisecurity.userdetails.UserDetailsService
Specified by:
loadUserByUsername in interface UserDao
Parameters:
username - the user's username
Returns:
userDetails populated userDetails object
Throws:
org.acegisecurity.userdetails.UsernameNotFoundException
See Also:
UserDetailsService.loadUserByUsername(java.lang.String)


Copyright � 2002-2006