|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - The generic type of the domain class the DAO is responsible forID - The generic type of the domain class' identifierpublic interface ConvenienceGenericDao<T,ID extends Serializable>
Extends the GenericDao with a few convenience methods. As EL4J only supports Hibernate as persistence framework it's more convenient to use ConvenienceGenericHibernateDao directly.
| Method Summary | |
|---|---|
void |
delete(ID id)
Deprecated. Renamed to deleteById as of el4j 1.6 |
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 |
findByIdLazy(ID id)
Retrieves a domain object by identifier lazily. |
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. |
| Methods inherited from interface ch.elca.el4j.services.persistence.generic.dao.GenericDao |
|---|
delete, findByQuery, findCountByQuery, getPersistentClass, refresh, reload, saveOrUpdate, setPersistentClass |
| Method Detail |
|---|
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
T findByIdLazy(ID id)
throws DataRetrievalFailureException,
DataAccessException
DataRetrievalFailureException
DataAccessExceptionfindById
@Deprecated
void delete(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
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||