org.openwms.core.integration.jpa
Class UserDaoImpl

java.lang.Object
  extended by org.openwms.core.integration.jpa.AbstractGenericJpaDao<User,Long>
      extended by org.openwms.core.integration.jpa.UserDaoImpl
All Implemented Interfaces:
GenericDao<User,Long>, UserDao

@Transactional(propagation=MANDATORY)
@Repository(value="userDao")
public class UserDaoImpl
extends AbstractGenericJpaDao<User,Long>
implements UserDao

An UserDaoImpl is an extension of a AbstractGenericJpaDao about functionality regarding Users. The stereotype annotation Repository marks this class as DAO in the architecture and enables exception translation and component scanning. It can be injected by name "userDao".

All methods have to be invoked within an active transaction context.

Since:
0.1
Version:
$Revision: 1541 $
Author:
Heiko Scherrer
See Also:
AbstractGenericJpaDao, UserDao

Field Summary
static String COMPONENT_NAME
          Springs component name.
 
Fields inherited from class org.openwms.core.integration.jpa.AbstractGenericJpaDao
logger
 
Fields inherited from interface org.openwms.core.integration.GenericDao
FIND_ALL, FIND_BY_ID
 
Constructor Summary
UserDaoImpl()
           
 
Method Summary
 List<User> findAll()
          Find all entities and return them as a List.
 User findByNameAndPassword(UserPassword userPassword)
          Find an User by his userName and password.
protected  String getFindAllQuery()
          Returns the name of the NamedQuery to find all Entity classes.
protected  String getFindByUniqueIdQuery()
          Returns the name of the NamedQuery to find an Entity by the business key.
 void persist(User user)
          Persist a transient entity.
 void remove(User user)
          Removes an already persistent entity.
 User save(User user)
          Synchronize an entity with the persistence layer and return it.
 
Methods inherited from class org.openwms.core.integration.jpa.AbstractGenericJpaDao
beforeUpdate, findById, findByNamedParameters, findByPositionalParameters, findByUniqueId, getEm, getPersistentClass, setPersistentClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openwms.core.integration.GenericDao
findById, findByNamedParameters, findByPositionalParameters, findByUniqueId, setPersistentClass
 

Field Detail

COMPONENT_NAME

public static final String COMPONENT_NAME
Springs component name.

See Also:
Constant Field Values
Constructor Detail

UserDaoImpl

public UserDaoImpl()
Method Detail

getFindAllQuery

protected String getFindAllQuery()
Description copied from class: AbstractGenericJpaDao
Returns the name of the NamedQuery to find all Entity classes.

Specified by:
getFindAllQuery in class AbstractGenericJpaDao<User,Long>
Returns:
Name of the query
See Also:
AbstractGenericJpaDao.getFindAllQuery()

getFindByUniqueIdQuery

protected String getFindByUniqueIdQuery()
Description copied from class: AbstractGenericJpaDao
Returns the name of the NamedQuery to find an Entity by the business key.

Specified by:
getFindByUniqueIdQuery in class AbstractGenericJpaDao<User,Long>
Returns:
Name of the query
See Also:
AbstractGenericJpaDao.getFindByUniqueIdQuery()

findAll

public List<User> findAll()
Description copied from class: AbstractGenericJpaDao
Find all entities and return them as a List.

Specified by:
findAll in interface GenericDao<User,Long>
Overrides:
findAll in class AbstractGenericJpaDao<User,Long>
Returns:
List of all Users
See Also:
AbstractGenericJpaDao.findAll()

persist

public void persist(User user)
Persist a transient entity. Is the passed in User object is the SuperUser or null no action is performed.

Specified by:
persist in interface GenericDao<User,Long>
Overrides:
persist in class AbstractGenericJpaDao<User,Long>
Parameters:
user - Entity instance to be persisted

save

public User save(User user)
Synchronize an entity with the persistence layer and return it. Is the passed in User object is the SuperUser or null no action is performed.

Specified by:
save in interface GenericDao<User,Long>
Overrides:
save in class AbstractGenericJpaDao<User,Long>
Parameters:
user - Entity instance to be synchronized with the persistence layer
Returns:
The synchronized entity instance. If JPA is used as implementation, the returned instance is managed.

remove

public void remove(User user)
Removes an already persistent entity. Is the passed in User object is the SuperUser or null no action is performed.

Specified by:
remove in interface GenericDao<User,Long>
Overrides:
remove in class AbstractGenericJpaDao<User,Long>
Parameters:
user - Entity instance to be removed

findByNameAndPassword

public User findByNameAndPassword(UserPassword userPassword)
Find an User by his userName and password.

Specified by:
findByNameAndPassword in interface UserDao
Parameters:
userPassword - Stores the userName and password.
Returns:
The User if found, otherwise might be null


Copyright © 2005-2011 openwms.org. All Rights Reserved.