org.perfectjpattern.jee.integration.dao
Class SpringGenericDao<Id extends Serializable,Element>

java.lang.Object
  extended by org.perfectjpattern.jee.integration.dao.JpaBaseDao<Id,Element>
      extended by org.perfectjpattern.jee.integration.dao.HibernateGenericDao<Id,Element>
          extended by org.perfectjpattern.jee.integration.dao.SpringGenericDao<Id,Element>
Type Parameters:
Id - Identification type
Element - Element type
All Implemented Interfaces:
IBaseDao<Id,Element>, IBaseReadOnlyDao<Id,Element>, IFinderExecutor<Element>, IGenericDao<Id,Element>, IGenericReadOnlyDao<Id,Element>

public class SpringGenericDao<Id extends Serializable,Element>
extends HibernateGenericDao<Id,Element>
implements IFinderExecutor<Element>

Spring-based implementation of IGenericDao

Version:
$ $Date: Nov 5, 2008 11:40:00 AM $
Author:
Giovanni Azua
 

Constructor Summary
protected SpringGenericDao(Class<Element> aPersistentClass, ISessionStrategy aSessionStrategy, ITransactionStrategy aTransactionStrategy)
          Constructs a SpringGenericReadOnlyDao instance from the persistent class type and the ISessionStrategy that creates Session instances and the ITransactionStrategy that creates Transaction instances
 
Method Summary
 List<Element> execute(Method aMethod, Object... anArguments)
          
 IArgumentTypeResolver getArgumentTypeResolver()
          Returns the argumentTypeResolver
 IFinderNamingStrategy getNamingStrategy()
          Returns the namingStrategy
 void setArgumentTypeResolver(IArgumentTypeResolver anArgumentTypeResolver)
          Sets the argumentTypeResolver
 void setNamingStrategy(IFinderNamingStrategy aNamingStrategy)
          Sets the namingStrategy
 
Methods inherited from class org.perfectjpattern.jee.integration.dao.HibernateGenericDao
findByExample, getActualSession
 
Methods inherited from class org.perfectjpattern.jee.integration.dao.JpaBaseDao
contains, count, create, delete, deleteAll, findAll, findById, getPersistentClass, getSession, getSessionStrategy, getTransaction, getTransactionStrategy, setEntityManager, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.perfectjpattern.jee.api.integration.dao.IBaseDao
create, delete, deleteAll, update
 
Methods inherited from interface org.perfectjpattern.jee.api.integration.dao.IBaseReadOnlyDao
contains, count, findAll, findById, getSession, getTransaction
 

Constructor Detail

SpringGenericDao

protected SpringGenericDao(Class<Element> aPersistentClass,
                           ISessionStrategy aSessionStrategy,
                           ITransactionStrategy aTransactionStrategy)
Constructs a SpringGenericReadOnlyDao instance from the persistent class type and the ISessionStrategy that creates Session instances and the ITransactionStrategy that creates Transaction instances

Parameters:
aPersistentClass - The persistent Java Bean class
aSessionStrategy - Strategy that creates Sessions
aTransactionStrategy - Strategy that creates Transaction
Throws:
IllegalArgumentException - 'aPersistentClass' must not be null
IllegalArgumentException - 'aPersistentClass' must be a class type
IllegalArgumentException - 'aDaoSessionStrategy' must not be null
IllegalArgumentException - 'aDaoTransactionStrategy' must not be null
Method Detail

execute

public List<Element> execute(Method aMethod,
                             Object... anArguments)

Specified by:
execute in interface IFinderExecutor<Element>

getNamingStrategy

public final IFinderNamingStrategy getNamingStrategy()
Returns the namingStrategy

Returns:
the namingStrategy

setNamingStrategy

public final void setNamingStrategy(IFinderNamingStrategy aNamingStrategy)
Sets the namingStrategy

Parameters:
aNamingStrategy - the namingStrategy to set

getArgumentTypeResolver

public final IArgumentTypeResolver getArgumentTypeResolver()
Returns the argumentTypeResolver

Returns:
the argumentTypeResolver

setArgumentTypeResolver

public final void setArgumentTypeResolver(IArgumentTypeResolver anArgumentTypeResolver)
Sets the argumentTypeResolver

Parameters:
anArgumentTypeResolver - the argumentTypeResolver to set


Copyright © 2007-2009. All Rights Reserved.