org.synyx.hades.dao.orm
Class GenericDaoFactoryBean<T extends GenericDao<?,?>>

java.lang.Object
  extended by org.synyx.hades.dao.orm.GenericDaoFactory
      extended by org.synyx.hades.dao.orm.GenericDaoFactoryBean<T>
Type Parameters:
T - the type of the DAO
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

public class GenericDaoFactoryBean<T extends GenericDao<?,?>>
extends GenericDaoFactory
implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

Special GenericDaoFactory adapter for Springs FactoryBean interface to allow easy setup of DAO factories via Spring configuration.

Author:
Oliver Gierke - gierke@synyx.de, Eberhard Wolff

Constructor Summary
GenericDaoFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
static
<T extends GenericDao<?,?>>
GenericDaoFactoryBean<T>
create(java.lang.Class<T> daoInterface, javax.persistence.EntityManager em)
          Creates a new GenericDaoFactoryBean.
 java.lang.Object getObject()
           
 java.lang.Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setCustomDaoImplementation(java.lang.Object customDaoImplementation)
          Setter to inject a custom DAO implementation.
 void setDaoInterface(java.lang.Class<? extends T> daoInterface)
          Setter to inject the dao interface to implement.
 
Methods inherited from class org.synyx.hades.dao.orm.GenericDaoFactory
create, getDao, getDao, getDaoClass, getEntityManager, getQueryLookupStrategy, setEntityManager, setQueryLookupStrategy, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericDaoFactoryBean

public GenericDaoFactoryBean()
Method Detail

create

public static <T extends GenericDao<?,?>> GenericDaoFactoryBean<T> create(java.lang.Class<T> daoInterface,
                                                                          javax.persistence.EntityManager em)
Creates a new GenericDaoFactoryBean.

Type Parameters:
T -
Parameters:
daoInterface -
em -
Returns:

setDaoInterface

public void setDaoInterface(java.lang.Class<? extends T> daoInterface)
Setter to inject the dao interface to implement. Defaults to GenericDao.

Parameters:
daoInterface - the daoInterface to set

setCustomDaoImplementation

public void setCustomDaoImplementation(java.lang.Object customDaoImplementation)
Setter to inject a custom DAO implementation. This class needs

Parameters:
customDaoImplementation - the customDaoImplementation to set

getObject

public java.lang.Object getObject()
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean

getObjectType

public java.lang.Class<?> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean


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