org.synyx.hades.sample.dao.impl
Class UserDaoImpl

java.lang.Object
  extended by org.synyx.hades.sample.dao.impl.UserDaoImpl
All Implemented Interfaces:
UserDaoCustom

public class UserDaoImpl
extends java.lang.Object
implements UserDaoCustom

Implementation fo the custom DAo functionality declared in UserDaoCustom based on JPA. To use this implementation in combination with Hades you can either register it programatically:

 EntityManager em = ... // Obtain EntityManager
 
 UserDaoCustom custom = new UserDaoImpl();
 custom.setEntityManager(em);
 
 GenericDaoFactory factory = GenericDaoFactory.create(em);
 UserDao dao = factory.getDao(UserDao.class, custom);
 
Using the Spring namespace the implementation will just get picked up due to the classpath scanning for implementations with the Impl postfix.
 <hades:dao-config base-package="org.synyx.hades.sample.dao" />
 
If you need to manually configure the custom instance see UserDaoJdbcImpl for an example.

Author:
Oliver Gierke - gierke@synyx.de

Constructor Summary
UserDaoImpl()
           
 
Method Summary
 java.util.List<User> myCustomBatchOperation()
          Custom DAO operation.
 void setEntityManager(javax.persistence.EntityManager em)
          Configure the entity manager to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserDaoImpl

public UserDaoImpl()
Method Detail

setEntityManager

public void setEntityManager(javax.persistence.EntityManager em)
Configure the entity manager to be used.

Parameters:
em - the EntityManager to set.

myCustomBatchOperation

public java.util.List<User> myCustomBatchOperation()
Description copied from interface: UserDaoCustom
Custom DAO operation.

Specified by:
myCustomBatchOperation in interface UserDaoCustom
Returns:


Copyright © 2009-2010 Synyx GmbH & Co. KG. All Rights Reserved.