public class HibernateCRUDDao<T> extends HibernateDao
HibernateDao.DaoBlock, HibernateDao.DaoBlockR<R>| Constructor and Description |
|---|
HibernateCRUDDao(HibernateDaoContext context,
Class<T> entityClass) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(Serializable id,
T entity) |
void |
add(T entity) |
void |
clear() |
protected void |
clearEach() |
protected org.hibernate.Criteria |
createCriteria(org.hibernate.Session session) |
protected org.hibernate.Query |
createDeleteQuery(org.hibernate.Session session,
String additional) |
void |
delete(Serializable id) |
void |
delete(T entity) |
boolean |
exists(Serializable id) |
T |
get(Serializable id) |
T |
getOrNull(Serializable id) |
List<T> |
list() |
protected void |
update(T detachedEntity) |
createDeleteQuery, createDeleteQuery, deleteEntities, getContext, getSession, logAdditionalInfo, logWhenRollbacking, transact, transactpublic HibernateCRUDDao(HibernateDaoContext context, Class<T> entityClass)
public void clear()
throws DaoException
DaoExceptionpublic List<T> list() throws DaoException
DaoExceptionpublic boolean exists(Serializable id) throws DaoException
DaoExceptionpublic void add(T entity) throws DaoException
DaoExceptionpublic T get(Serializable id) throws EntityNotFoundException, DaoException
EntityNotFoundExceptionDaoExceptionpublic T getOrNull(Serializable id) throws EntityNotFoundException, DaoException
EntityNotFoundExceptionDaoExceptionpublic void delete(T entity) throws DaoException
DaoExceptionpublic void delete(Serializable id) throws EntityNotFoundException, DaoException
EntityNotFoundExceptionDaoExceptionprotected void clearEach()
throws DaoException
DaoExceptionprotected void add(Serializable id, T entity) throws EntityAlreadyExistsException, DaoException
protected void update(T detachedEntity) throws DaoException
DaoExceptionprotected org.hibernate.Criteria createCriteria(org.hibernate.Session session)
throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionprotected org.hibernate.Query createDeleteQuery(org.hibernate.Session session,
String additional)
throws org.hibernate.HibernateException
org.hibernate.HibernateException