| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - the domain object typeID - the id of the domain object to findpublic interface ConvenienceGenericJpaDao<T,ID extends Serializable>
This interface extends ConvenienceGenericDao with query methods using
 CriteriaQuerys.
| Method Summary | |
|---|---|
 void | 
delete(Collection<T> entities)
Deletes the given domain objects.  | 
 void | 
delete(T entity)
Deletes the given domain object.  | 
 void | 
deleteAll()
Deletes all available T. | 
 void | 
deleteById(ID id)
Deletes the domain object with the given id, disregarding any concurrent modifications that may have occurred.  | 
 T | 
findById(ID id)
Retrieves a domain object by identifier.  | 
 T | 
findById(ID id,
         DataExtent extent)
Retrieves a domain object by identifier.  | 
 List<T> | 
findByQuery(QueryBuilder criteria)
Retrieves all the domain objects matching the JPA criteria.  | 
 List<T> | 
findByQuery(QueryBuilder criteria,
            DataExtent extent)
Retrieves all the domain objects matching the JPA criteria.  | 
 List<T> | 
findByQuery(QueryBuilder criteria,
            int firstResult,
            int maxResults)
Retrieves a range of domain objects matching the JPA criteria.  | 
 List<T> | 
findByQuery(QueryBuilder criteria,
            int firstResult,
            int maxResults,
            DataExtent extent)
Retrieves a range of domain objects matching the JPA criteria.  | 
 int | 
findCountByQuery(QueryBuilder criteria)
Retrieves the number of domain objects matching the JPA criteria.  | 
 void | 
flush()
Sometimes, the way Hibernate handles all the actions in a session is very unbelievable.  | 
 List<T> | 
getAll()
Retrieves all the domain objects of type T.  | 
 List<T> | 
getAll(DataExtent extent)
Retrieves all the domain objects of type T.  | 
 Class<T> | 
getPersistentClass()
Needed because the Java generics throw away this type information.  | 
 T | 
merge(T entity)
merge the given entity.  | 
 T | 
persist(T entity)
persist the given entity.  | 
 T | 
refresh(T entity)
Re-reads the state of the given domain object from the underlying store.  | 
 T | 
refresh(T entity,
        DataExtent extent)
Re-reads the state of the given domain object from the underlying store.  | 
 T | 
reload(T entity)
Re-reads the state of the given domain object from the undermost store (eg. the database).  | 
 T | 
reload(T entity,
       DataExtent extent)
Re-reads the state of the given domain object from the undermost store (eg. the database).  | 
 T | 
saveOrUpdate(T entity)
Saves or updates the given domain object.  | 
 T | 
saveOrUpdateAndFlush(T entity)
Deprecated.  | 
 void | 
setPersistentClass(Class<T> c)
New: this callback is in general no longer required (the constructor should figure the type out itself).  | 
| Method Detail | 
|---|
Class<T> getPersistentClass()
void setPersistentClass(Class<T> c)
c - Mandatory. The domain class this DAO is responsible for.
T refresh(T entity)
          throws DataAccessException,
                 DataRetrievalFailureException
entity - The domain object to re-read the state of
DataAccessException - If general data access problem occurred
DataRetrievalFailureException - If domain object could not be re-read
T reload(T entity)
         throws DataAccessException,
                DataRetrievalFailureException
entity - The domain object to re-load the state of
DataAccessException - If general data access problem occurred
DataRetrievalFailureException - If domain object could not be re-loaded
T saveOrUpdate(T entity)
               throws DataAccessException,
                      DataIntegrityViolationException,
                      OptimisticLockingFailureException
entity - The domain object to save or update
DataAccessException - If general data access problem occurred
DataIntegrityViolationException - If domain object could not be inserted due to a data
             integrity violation
OptimisticLockingFailureException - If domain object has been modified/deleted in the meantime
void delete(Collection<T> entities)
            throws OptimisticLockingFailureException,
                   DataAccessException
entities - The domain objects to delete.
DataAccessException - If general data access problem occurred
OptimisticLockingFailureException - If domain object has been modified/deleted in the meantime
T findById(ID id)
           throws DataRetrievalFailureException,
                  DataAccessException
id - The id of the domain object to find
DataRetrievalFailureException - If no domain object could be found with given id.
DataAccessException - If general data access problem occurred
void deleteById(ID id)
                throws OptimisticLockingFailureException,
                       DataAccessException
id - The id of the domain object to delete
OptimisticLockingFailureException - If domain object has been deleted in the meantime
DataAccessException - If general data access problem occurred
List<T> getAll()
               throws DataAccessException
DataAccessException - If general data access problem occurred
void delete(T entity)
            throws OptimisticLockingFailureException,
                   DataAccessException
entity - The domain object to delete
OptimisticLockingFailureException - If domain object has been modified/deleted in the meantime
DataAccessException - If general data access problem occurred
void deleteAll()
               throws OptimisticLockingFailureException,
                      DataAccessException
T.
OptimisticLockingFailureException - If domain object has been modified/deleted in the meantime
DataAccessException - If general data access problem occurredvoid flush()
  delete(project);
  project.setId(null) <= to insert new one
  insert(project);
 
 It could cause java.sql.BatchUpdateException:
 ORA-00001: unique constraint BECAUSE Hibernate doesn't flush
 the previous action first.
 This method provides a way to flush manually some action.
 Note that this method is only used in an extremely rare case.
@Deprecated
T saveOrUpdateAndFlush(T entity)
                       throws DataAccessException,
                              DataIntegrityViolationException,
                              OptimisticLockingFailureException
entity - The domain object to save or update
DataAccessException
DataIntegrityViolationException
OptimisticLockingFailureException
T merge(T entity)
        throws DataAccessException,
               DataIntegrityViolationException,
               OptimisticLockingFailureException
entity - the entity to merge.
DataAccessException
DataIntegrityViolationException
OptimisticLockingFailureException
T persist(T entity)
          throws DataAccessException,
                 DataIntegrityViolationException,
                 OptimisticLockingFailureException
entity - the entity to persist.
DataAccessException
DataIntegrityViolationException
OptimisticLockingFailureException
List<T> findByQuery(QueryBuilder criteria)
                    throws DataAccessException
criteria - the criteria that the result has to fulfill
DataAccessExceptionConvenienceJpaTemplate#findByCriteria(DetachedCriteria)
List<T> findByQuery(QueryBuilder criteria,
                    DataExtent extent)
                    throws DataAccessException
criteria - the criteria that the result has to fulfillextent - the extent in which objects get loaded.
DataAccessExceptionConvenienceJpaTemplate#findByCriteria(DetachedCriteria)
List<T> findByQuery(QueryBuilder criteria,
                    int firstResult,
                    int maxResults)
                    throws DataAccessException
criteria - the criteria that the result has to fulfillfirstResult - the index of the first result to returnmaxResults - the maximum number of results to return
DataAccessExceptionConvenienceJpaTemplate#findByCriteria(DetachedCriteria, int, int)
List<T> findByQuery(QueryBuilder criteria,
                    int firstResult,
                    int maxResults,
                    DataExtent extent)
                    throws DataAccessException
criteria - the criteria that the result has to fulfillfirstResult - the index of the first result to returnmaxResults - the maximum number of results to returnextent - the extent in which objects get loaded.
DataAccessExceptionConvenienceJpaTemplate#findByCriteria(DetachedCriteria, int, int)
int findCountByQuery(QueryBuilder criteria)
                     throws DataAccessException
criteria - the criteria that the result has to fulfill
DataAccessExceptionConvenienceJpaTemplate#findCountByCriteria(DetachedCriteria)
T findById(ID id,
           DataExtent extent)
           throws DataRetrievalFailureException,
                  DataAccessException
id - The id of the domain object to findextent - the extent in which objects get loaded.
DataRetrievalFailureException - If no domain object could be found with given id.
DataAccessException - If general data access problem occurred
List<T> getAll(DataExtent extent)
               throws DataAccessException
extent - the extent in which objects get loaded.
DataAccessException - If general data access problem occurred
T refresh(T entity,
          DataExtent extent)
          throws DataAccessException,
                 DataRetrievalFailureException
entity - The domain object to re-read the state ofextent - the extent in which objects get loaded.
DataAccessException - If general data access problem occurred
DataRetrievalFailureException - If domain object could not be re-read
T reload(T entity,
         DataExtent extent)
         throws DataAccessException,
                DataRetrievalFailureException
entity - The domain object to re-read the state ofextent - the extent in which objects get loaded.
DataAccessException - If general data access problem occurred
DataRetrievalFailureException - If domain object could not be re-read
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||