org.appfuse.persistence.hibernate
Class UserDAOHibernate

java.lang.Object
  extended byorg.springframework.orm.hibernate.support.HibernateDaoSupport
      extended byorg.appfuse.persistence.hibernate.UserDAOHibernate
All Implemented Interfaces:
DAO, InitializingBean, UserDAO

public class UserDAOHibernate
extends HibernateDaoSupport
implements UserDAO

This class interacts with Hibernate's to save and retrieve User objects.

View Source

Version:
$Revision: 1.1 $ $Date: 2004/03/31 13:04:24 $
Author:
Matt Raible

Field Summary
 
Fields inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
logger
 
Constructor Summary
UserDAOHibernate()
           
 
Method Summary
 User getUser(String username)
          Get user by username.
 UserCookie getUserCookie(String cookieId)
          Gets a userCookie object from the database, based on cookieId
 List getUsers(User user)
          Gets a list of users based on parameters passed in.
 void removeUser(User user)
          Removes a user from the database by id
 void removeUserCookies(String username)
          Removes all cookies for a specified username
 User saveUser(User user)
          Saves a user's information
 void saveUserCookie(UserCookie cookie)
          Saves a userCookie object to the database
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
afterPropertiesSet, closeSessionIfNecessary, convertHibernateAccessException, getHibernateTemplate, getSession, getSession, getSessionFactory, initDao, setHibernateTemplate, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserDAOHibernate

public UserDAOHibernate()
Method Detail

getUser

public User getUser(String username)
             throws DAOException
Get user by username.

Specified by:
getUser in interface UserDAO
Parameters:
username - the user's username
Returns:
a populated user object
Throws:
DAOException - if anything goes wrong

getUsers

public List getUsers(User user)
              throws DAOException
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
Throws:
DAOException
See Also:
UserDAO.getUsers(org.appfuse.model.User)

saveUser

public User saveUser(User user)
              throws DAOException
Description copied from interface: UserDAO
Saves a user's information

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

removeUser

public void removeUser(User user)
                throws DAOException
Description copied from interface: UserDAO
Removes a user from the database by id

Specified by:
removeUser in interface UserDAO
Parameters:
user - the object to be removed
Throws:
DAOException
See Also:
UserDAO.removeUser(org.appfuse.model.User)

getUserCookie

public UserCookie getUserCookie(String cookieId)
                         throws DAOException
Description copied from interface: UserDAO
Gets a userCookie object from the database, based on cookieId

Specified by:
getUserCookie in interface UserDAO
Parameters:
cookieId -
Throws:
DAOException
See Also:
UserDAO.getUserCookie(java.lang.String)

removeUserCookies

public void removeUserCookies(String username)
Description copied from interface: UserDAO
Removes all cookies for a specified username

Specified by:
removeUserCookies in interface UserDAO
Parameters:
username -
See Also:
UserDAO.removeUserCookies(java.lang.String)

saveUserCookie

public void saveUserCookie(UserCookie cookie)
                    throws DAOException
Description copied from interface: UserDAO
Saves a userCookie object to the database

Specified by:
saveUserCookie in interface UserDAO
Parameters:
cookie -
Throws:
DAOException
See Also:
UserDAO.saveUserCookie(org.appfuse.model.UserCookie)


Copyright © 2002-2004