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, transact
public HibernateCRUDDao(HibernateDaoContext context, Class<T> entityClass)
public void clear() throws DaoException
DaoException
public List<T> list() throws DaoException
DaoException
public boolean exists(Serializable id) throws DaoException
DaoException
public void add(T entity) throws DaoException
DaoException
public T get(Serializable id) throws EntityNotFoundException, DaoException
EntityNotFoundException
DaoException
public T getOrNull(Serializable id) throws EntityNotFoundException, DaoException
EntityNotFoundException
DaoException
public void delete(T entity) throws DaoException
DaoException
public void delete(Serializable id) throws EntityNotFoundException, DaoException
EntityNotFoundException
DaoException
protected void clearEach() throws DaoException
DaoException
protected void add(Serializable id, T entity) throws EntityAlreadyExistsException, DaoException
protected void update(T detachedEntity) throws DaoException
DaoException
protected org.hibernate.Criteria createCriteria(org.hibernate.Session session) throws org.hibernate.HibernateException
org.hibernate.HibernateException
protected org.hibernate.Query createDeleteQuery(org.hibernate.Session session, String additional) throws org.hibernate.HibernateException
org.hibernate.HibernateException