|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.synyx.hades.dao.orm.GenericDaoFactory
public class GenericDaoFactory
Factory bean to create instances of a given DAO interface. Creates a proxy
implementing the configured DAO interface and apply an advice handing the
control to the FinderExecuterMethodInterceptor when a method
beginning with the configured finder prefix is called. This defaults to
. Furthermore finder
resolution can be configured by setting queryLookupStrategy which
defaults to QueryLookupStrategy.getDefault()
| Constructor Summary | |
|---|---|
protected |
GenericDaoFactory()
Protected constructor to prevent simple construction from clients. |
| Method Summary | ||
|---|---|---|
static GenericDaoFactory |
create(javax.persistence.EntityManager entityManager)
Creates a new GenericDaoFactory with the given
EntityManager. |
|
|
getDao(java.lang.Class<T> daoInterface)
Returns a DAO instance for the given interface. |
|
|
getDao(java.lang.Class<T> daoInterface,
java.lang.Object customDaoImplementation)
Returns a DAO instance for the given interface backed by an instance providing implementation logic for custom logic. |
|
protected java.lang.Class<? extends GenericJpaDao> |
getDaoClass()
Determines the base class for the DAO to be created by checking the EntityManager's concrete type. |
|
protected javax.persistence.EntityManager |
getEntityManager()
Returns the EntityManager. |
|
protected void |
prepare(org.springframework.aop.framework.ProxyFactory proxyFactory)
Callback method to prepare the given ProxyFactory to e.g. add
further interceptors. |
|
void |
setEntityManager(javax.persistence.EntityManager entityManager)
Setter to inject entity manager. |
|
void |
setQueryLookupStrategy(QueryLookupStrategy queryLookupStrategy)
Sets the strategy of how to lookup a query to execute finders. |
|
protected void |
validate(java.lang.Class<? extends GenericDao<?,?>> daoInterface,
java.lang.Object customDaoImplementation)
Validates the given DAO interface as well as the given custom implementation. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected GenericDaoFactory()
| Method Detail |
|---|
public static GenericDaoFactory create(javax.persistence.EntityManager entityManager)
GenericDaoFactory with the given
EntityManager.
entityManager -
protected javax.persistence.EntityManager getEntityManager()
EntityManager.
public void setEntityManager(javax.persistence.EntityManager entityManager)
entityManager - the EntityManager to setpublic void setQueryLookupStrategy(QueryLookupStrategy queryLookupStrategy)
queryLookupStrategy - the createFinderQueries to setpublic <T extends GenericDao<?,?>> T getDao(java.lang.Class<T> daoInterface)
T - daoInterface -
public <T extends GenericDao<?,?>> T getDao(java.lang.Class<T> daoInterface,
java.lang.Object customDaoImplementation)
T - daoInterface - customDaoImplementation -
protected void prepare(org.springframework.aop.framework.ProxyFactory proxyFactory)
ProxyFactory to e.g. add
further interceptors. The QueryExecuterMethodInterceptor will be
added after this method was called, so all interceptors or
advisors added in this method will kick in before it.
proxyFactory - GenericDaoFactoryBean.prepare(ProxyFactory)protected java.lang.Class<? extends GenericJpaDao> getDaoClass()
EntityManager's concrete type. If no well known type can be
detected #DEFAULT_DAO_CLASS will be returned.
Protected to eventually customize base class - see #102 for details.
protected void validate(java.lang.Class<? extends GenericDao<?,?>> daoInterface,
java.lang.Object customDaoImplementation)
daoInterface - customDaoImplementation -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||