org.appfuse.dao.jpa
Class UserDaoJpa
java.lang.Object
org.appfuse.dao.jpa.GenericDaoJpa<org.appfuse.model.User,java.lang.Long>
org.appfuse.dao.jpa.UserDaoJpa
- All Implemented Interfaces:
- org.acegisecurity.userdetails.UserDetailsService, GenericDao<org.appfuse.model.User,java.lang.Long>, UserDao
public class UserDaoJpa
- extends GenericDaoJpa<org.appfuse.model.User,java.lang.Long>
- implements UserDao, org.acegisecurity.userdetails.UserDetailsService
This class interacts with Spring's HibernateTemplate to save/delete and
retrieve User objects.
- Author:
- Matt Raible
Modified by Dan Kibler
Extended to implement Acegi UserDetailsService interface by David Carter david@carter.net
Modified by Bryan Noll to work with
the new BaseDaoHibernate implementation that uses generics.
|
Constructor Summary |
UserDaoJpa()
Constructor that sets the entity to User.class. |
|
Method Summary |
java.util.List<org.appfuse.model.User> |
getUsers()
Gets a list of users ordered by the uppercase version of their username. |
org.acegisecurity.userdetails.UserDetails |
loadUserByUsername(java.lang.String username)
Gets users information based on login name. |
org.appfuse.model.User |
saveUser(org.appfuse.model.User user)
Save user and flush entityManager |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UserDaoJpa
public UserDaoJpa()
- Constructor that sets the entity to User.class.
getUsers
public java.util.List<org.appfuse.model.User> getUsers()
- Gets a list of users ordered by the uppercase version of their username.
- Specified by:
getUsers in interface UserDao
- Returns:
- List populated list of users
loadUserByUsername
@Transactional
public org.acegisecurity.userdetails.UserDetails loadUserByUsername(java.lang.String username)
throws org.acegisecurity.userdetails.UsernameNotFoundException
- 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 - thrown when user not found in database
saveUser
public org.appfuse.model.User saveUser(org.appfuse.model.User user)
- Save user and flush entityManager
- Specified by:
saveUser in interface UserDao
- Parameters:
user - the user to save
- Returns:
- the updated user
Copyright © 2003-2007. All Rights Reserved.