ch.elca.el4j.services.persistence.hibernate.dao
Interface ConvenienceGenericHibernateDao<T,ID extends Serializable>

Type Parameters:
T - the domain object type
ID - the id of the domain object to find
All Superinterfaces:
ConvenienceGenericDao<T,ID>, GenericDao<T>
All Known Implementing Classes:
GenericHibernateDao

public interface ConvenienceGenericHibernateDao<T,ID extends Serializable>
extends ConvenienceGenericDao<T,ID>

This interface extends ConvenienceGenericDao with query methods using DetachedCriterias.

Author:
Stefan Wismer (SWI)

Method Summary
 List<T> findByCriteria(DetachedCriteria hibernateCriteria)
           
 List<T> findByCriteria(DetachedCriteria hibernateCriteria, int firstResult, int maxResults)
           
 int findCountByCriteria(DetachedCriteria hibernateCriteria)
           
 ConvenienceHibernateTemplate getConvenienceHibernateTemplate()
           
 Order[] getDefaultOrder()
           
 T saveOrUpdateAndFlush(T entity)
           
 void setDefaultOrder(Order... defaultOrder)
           
 
Methods inherited from interface ch.elca.el4j.services.persistence.generic.dao.ConvenienceGenericDao
delete, delete, deleteAll, findById, findByIdLazy, flush, getAll
 
Methods inherited from interface ch.elca.el4j.services.persistence.generic.dao.GenericDao
delete, findByQuery, findCountByQuery, getPersistentClass, refresh, saveOrUpdate, setPersistentClass
 

Method Detail

saveOrUpdateAndFlush

T saveOrUpdateAndFlush(T entity)
                       throws DataAccessException,
                              DataIntegrityViolationException,
                              OptimisticLockingFailureException
Parameters:
entity - The domain object to save or update
Returns:
The saved or updated object
Throws:
DataAccessException
DataIntegrityViolationException
OptimisticLockingFailureException

findByCriteria

List<T> findByCriteria(DetachedCriteria hibernateCriteria)
                       throws DataAccessException
Parameters:
hibernateCriteria - the criteria that the result has to fulfill
Returns:
all object that fulfill the criteria
Throws:
DataAccessException
See Also:
HibernateTemplate.findByCriteria(DetachedCriteria)

findByCriteria

List<T> findByCriteria(DetachedCriteria hibernateCriteria,
                       int firstResult,
                       int maxResults)
                       throws DataAccessException
Parameters:
hibernateCriteria - the criteria that the result has to fulfill
firstResult - the index of the first result to return
maxResults - the maximum number of results to return
Returns:
the specified subset of object that fulfill the criteria
Throws:
DataAccessException
See Also:
HibernateTemplate.findByCriteria(DetachedCriteria, int, int)

findCountByCriteria

int findCountByCriteria(DetachedCriteria hibernateCriteria)
                        throws DataAccessException
Parameters:
hibernateCriteria - the criteria that the result has to fulfill
Returns:
the number of objects that fulfill the criteria
Throws:
DataAccessException
See Also:
ConvenienceHibernateTemplate.findCountByCriteria(DetachedCriteria)

getConvenienceHibernateTemplate

ConvenienceHibernateTemplate getConvenienceHibernateTemplate()
Returns:
the convenience Hibernate template

getDefaultOrder

Order[] getDefaultOrder()
Returns:
the default Order to order the results

setDefaultOrder

void setDefaultOrder(Order... defaultOrder)
Parameters:
defaultOrder - the default Order to order the results


Copyright © 2005-2008 ELCA. All Rights Reserved.