org.perfectjpattern.jee.integration.dao
Class AbstractDaoFactory

java.lang.Object
  extended by org.perfectjpattern.jee.integration.dao.AbstractDaoFactory
All Implemented Interfaces:
IAbstractFactory, ISingleton, IBaseDaoFactory
Direct Known Subclasses:
HibernateDaoFactory, JpaDaoFactory

public abstract class AbstractDaoFactory
extends Object
implements IBaseDaoFactory, ISingleton

Abstract reusable base partial implementation for IBaseDaoFactory concrete implementations

Version:
$Revision: 1.0 $Date: Feb 19, 2009 12:16:49 PM $
Author:
Giovanni Azua
 

Constructor Summary
protected AbstractDaoFactory()
           
 
Method Summary
<Id extends Serializable,Element>
IBaseDao<Id,Element>
createDao(Class<Element> aPersistentClass)
          Returns the Base DAO implementation corresponding to the given model class type.
protected abstract
<Id extends Serializable,Element>
IBaseDao<Id,Element>
createDao(Class<Element> aPersistentClass, ISessionStrategy aSessionStrategy, ITransactionStrategy aTransactionStrategy)
           
<Id extends Serializable,Element>
IBaseReadOnlyDao<Id,Element>
createReadOnlyDao(Class<Element> aPersistentClass)
          Returns the Base Read-Only DAO implementation corresponding to the given model class type.
 void setDaoSessionStrategy(ISessionStrategy aSessionStrategy)
          Sets the DaoSessionStrategy
 void setDaoTransactionStrategy(ITransactionStrategy aTransactionStrategy)
          Sets the DaoTransactionStrategy
 void shutdown()
          Shuts down all DAO services, does all the necessary clean up
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDaoFactory

protected AbstractDaoFactory()
Method Detail

setDaoSessionStrategy

public void setDaoSessionStrategy(ISessionStrategy aSessionStrategy)
                           throws IllegalArgumentException
Sets the DaoSessionStrategy

Specified by:
setDaoSessionStrategy in interface IBaseDaoFactory
Parameters:
aSessionStrategy - ISessionStrategy to set
Throws:
IllegalArgumentException - 'aDaoSessionStrategy' must not be null

setDaoTransactionStrategy

public void setDaoTransactionStrategy(ITransactionStrategy aTransactionStrategy)
                               throws IllegalArgumentException
Sets the DaoTransactionStrategy

Specified by:
setDaoTransactionStrategy in interface IBaseDaoFactory
Parameters:
aTransactionStrategy - ITransactionStrategy to set
Throws:
IllegalArgumentException - 'aDaoTransactionStrategy' must not be null

shutdown

public void shutdown()
              throws DaoException
Shuts down all DAO services, does all the necessary clean up

Specified by:
shutdown in interface IBaseDaoFactory
Throws:
DaoException

createReadOnlyDao

public <Id extends Serializable,Element> IBaseReadOnlyDao<Id,Element> createReadOnlyDao(Class<Element> aPersistentClass)
                                                                    throws IllegalArgumentException
Returns the Base Read-Only DAO implementation corresponding to the given model class type. Provides a generic and reusable means to create cached DAO instances.

Specified by:
createReadOnlyDao in interface IBaseDaoFactory
Type Parameters:
Id - Id type
Element - Element type
Parameters:
aPersistentClass - Data model class type
Returns:
Base DAO implementation corresponding to the given model class type
Throws:
IllegalArgumentException - 'aPersistentClass' must not be null

createDao

public <Id extends Serializable,Element> IBaseDao<Id,Element> createDao(Class<Element> aPersistentClass)
                                                    throws IllegalArgumentException
Returns the Base DAO implementation corresponding to the given model class type. Provides a generic and reusable means to create cached DAO instances.

Specified by:
createDao in interface IBaseDaoFactory
Type Parameters:
Id - Id type
Element - Element type
Parameters:
aPersistentClass - Data model class type
Returns:
Base DAO implementation corresponding to the given model class type
Throws:
IllegalArgumentException - 'aPersistentClass' must not be null

createDao

protected abstract <Id extends Serializable,Element> IBaseDao<Id,Element> createDao(Class<Element> aPersistentClass,
                                                                                    ISessionStrategy aSessionStrategy,
                                                                                    ITransactionStrategy aTransactionStrategy)


Copyright © 2007-2009. All Rights Reserved.