net.sf.beanlib.hibernate3
Class DtoCentricHibernate3Template

java.lang.Object
  extended by org.springframework.orm.hibernate3.HibernateAccessor
      extended by org.springframework.orm.hibernate3.HibernateTemplate
          extended by net.sf.beanlib.hibernate3.DtoCentricHibernate3Template
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.orm.hibernate3.HibernateOperations

public class DtoCentricHibernate3Template
extends org.springframework.orm.hibernate3.HibernateTemplate

Base class for Hibernate 3 DTO Centric HibernateTemplate.

Author:
Joe D. Velopar

Nested Class Summary
 class DtoCentricHibernate3Template.DtoCentricCloseSuppressingInvocationHandler
          Cloned from HibernateTemplate.CloseSuppressingInvocationHandler so we can dig out the target session, if needs be.
 
Field Summary
private  String applicationPackagePrefix
           
private  Class applicationSampleClass
           
 
Fields inherited from class org.springframework.orm.hibernate3.HibernateAccessor
FLUSH_ALWAYS, FLUSH_AUTO, FLUSH_COMMIT, FLUSH_EAGER, FLUSH_NEVER, logger
 
Constructor Summary
DtoCentricHibernate3Template()
           
DtoCentricHibernate3Template(SessionFactory sessionFactory)
           
DtoCentricHibernate3Template(SessionFactory sessionFactory, boolean allowCreate)
           
 
Method Summary
protected  Session createSessionProxy(Session session)
           
 List find(String queryString, Object[] values)
           
 List findByNamedParam(String queryString, String[] paramNames, Object[] values)
           
 List findByNamedQuery(String queryName, Object[] values)
           
 List findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values)
           
 List findByNamedQueryAndValueBean(String queryName, Object valueBean)
           
 List findByValueBean(String queryString, Object valueBean)
           
 Object get(Class entityClass, Serializable id, LockMode lockMode)
           
 Object get(String entityName, Serializable id, LockMode lockMode)
           
private  Hibernate3DtoCopier getHibernateDtoCopier()
           
 DtoCentricHibernate3Template init(String applicationPackagePrefix, Class applicationSampleClass)
           
 Object load(Class entityClass, Serializable id, LockMode lockMode)
           
 Object load(String entityName, Serializable id, LockMode lockMode)
           
 List loadAll(Class entityClass)
           
 List loadByCriteria(CriteriaSpecifiable specifier)
           
 
Methods inherited from class org.springframework.orm.hibernate3.HibernateTemplate
applyNamedParameterToQuery, bulkUpdate, bulkUpdate, bulkUpdate, checkWriteOperationAllowed, clear, closeIterator, contains, delete, delete, deleteAll, enableFilter, evict, execute, execute, executeFind, find, find, findByCriteria, findByCriteria, findByExample, findByExample, findByNamedParam, findByNamedQuery, findByNamedQuery, findByNamedQueryAndNamedParam, flush, get, get, getFetchSize, getMaxResults, getQueryCacheRegion, getSession, initialize, isAllowCreate, isAlwaysUseNewSession, isCacheQueries, isCheckWriteOperations, isExposeNativeSession, iterate, iterate, iterate, load, load, load, lock, lock, merge, merge, persist, persist, prepareCriteria, prepareQuery, refresh, refresh, replicate, replicate, save, save, saveOrUpdate, saveOrUpdate, saveOrUpdateAll, setAllowCreate, setAlwaysUseNewSession, setCacheQueries, setCheckWriteOperations, setExposeNativeSession, setFetchSize, setMaxResults, setQueryCacheRegion, update, update, update, update
 
Methods inherited from class org.springframework.orm.hibernate3.HibernateAccessor
afterPropertiesSet, applyFlushMode, convertHibernateAccessException, convertJdbcAccessException, convertJdbcAccessException, disableFilters, enableFilters, flushIfNecessary, getDefaultJdbcExceptionTranslator, getEntityInterceptor, getFilterNames, getFlushMode, getJdbcExceptionTranslator, getSessionFactory, setBeanFactory, setEntityInterceptor, setEntityInterceptorBeanName, setFilterName, setFilterNames, setFlushMode, setFlushModeName, setJdbcExceptionTranslator, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applicationPackagePrefix

private String applicationPackagePrefix

applicationSampleClass

private Class applicationSampleClass
Constructor Detail

DtoCentricHibernate3Template

public DtoCentricHibernate3Template()

DtoCentricHibernate3Template

public DtoCentricHibernate3Template(SessionFactory sessionFactory)

DtoCentricHibernate3Template

public DtoCentricHibernate3Template(SessionFactory sessionFactory,
                                    boolean allowCreate)
Method Detail

init

public DtoCentricHibernate3Template init(String applicationPackagePrefix,
                                         Class applicationSampleClass)

getHibernateDtoCopier

private Hibernate3DtoCopier getHibernateDtoCopier()

get

public Object get(Class entityClass,
                  Serializable id,
                  LockMode lockMode)
           throws org.springframework.dao.DataAccessException
Specified by:
get in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
get in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

get

public Object get(String entityName,
                  Serializable id,
                  LockMode lockMode)
           throws org.springframework.dao.DataAccessException
Specified by:
get in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
get in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

load

public Object load(Class entityClass,
                   Serializable id,
                   LockMode lockMode)
            throws org.springframework.dao.DataAccessException
Specified by:
load in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
load in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

load

public Object load(String entityName,
                   Serializable id,
                   LockMode lockMode)
            throws org.springframework.dao.DataAccessException
Specified by:
load in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
load in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

loadAll

public List loadAll(Class entityClass)
             throws org.springframework.dao.DataAccessException
Specified by:
loadAll in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
loadAll in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

loadByCriteria

public List loadByCriteria(CriteriaSpecifiable specifier)
                    throws org.springframework.dao.DataAccessException
Throws:
org.springframework.dao.DataAccessException

find

public List find(String queryString,
                 Object[] values)
          throws org.springframework.dao.DataAccessException
Specified by:
find in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
find in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

findByNamedParam

public List findByNamedParam(String queryString,
                             String[] paramNames,
                             Object[] values)
                      throws org.springframework.dao.DataAccessException
Specified by:
findByNamedParam in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
findByNamedParam in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

findByValueBean

public List findByValueBean(String queryString,
                            Object valueBean)
                     throws org.springframework.dao.DataAccessException
Specified by:
findByValueBean in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
findByValueBean in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

findByNamedQuery

public List findByNamedQuery(String queryName,
                             Object[] values)
                      throws org.springframework.dao.DataAccessException
Specified by:
findByNamedQuery in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
findByNamedQuery in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

findByNamedQueryAndNamedParam

public List findByNamedQueryAndNamedParam(String queryName,
                                          String[] paramNames,
                                          Object[] values)
                                   throws org.springframework.dao.DataAccessException
Specified by:
findByNamedQueryAndNamedParam in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
findByNamedQueryAndNamedParam in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

findByNamedQueryAndValueBean

public List findByNamedQueryAndValueBean(String queryName,
                                         Object valueBean)
                                  throws org.springframework.dao.DataAccessException
Specified by:
findByNamedQueryAndValueBean in interface org.springframework.orm.hibernate3.HibernateOperations
Overrides:
findByNamedQueryAndValueBean in class org.springframework.orm.hibernate3.HibernateTemplate
Throws:
org.springframework.dao.DataAccessException

createSessionProxy

protected Session createSessionProxy(Session session)
Overrides:
createSessionProxy in class org.springframework.orm.hibernate3.HibernateTemplate