public class GeneralDAOImpl extends AbstractDAOImpl implements GeneralDAO
| Constructor and Description |
|---|
GeneralDAOImpl()
Constructs the DAO
|
GeneralDAOImpl(org.hibernate.SessionFactory sessionFactory)
Constructs the DAO
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Object entity)
Deletes an entity instance.
|
<T> void |
deleteById(Class<T> type,
Serializable id)
Deletes an entity instance.
|
<T> List<T> |
findAll(Class<T> type)
Returns all entities of the persistent type.
|
protected <T> List<T> |
findByCriteria(Class<T> type,
org.hibernate.criterion.Criterion... criterion)
Returns the list of entity instances that matches the provided crtieria.
|
<T> T |
findById(Class<T> type,
Serializable id,
boolean lock)
Finds an entity by ID.
|
protected org.hibernate.Criteria |
newCriteria(Class<?> type)
Returns a new criteria object.
|
void |
save(Object entity)
Saves an entity.
|
void |
saveOrUpdate(Object entity)
Saves or updates an entity, depending upon resolution of the
unsaved-value checks.
|
void |
update(Object entity)
Updates an entity.
|
clear, evict, first, flush, getNamedQuery, getSession, list, list, setSessionFactory, sync, unique, uniquepublic GeneralDAOImpl(org.hibernate.SessionFactory sessionFactory)
sessionFactory - Hibernate Session factory.public GeneralDAOImpl()
protected final org.hibernate.Criteria newCriteria(Class<?> type)
type - Entity type.protected final <T> List<T> findByCriteria(Class<T> type, org.hibernate.criterion.Criterion... criterion)
type - Entity type.criterion - Search criteria.public void delete(Object entity)
GeneralDAOdelete in interface GeneralDAOentity - Instance to delete.public <T> void deleteById(Class<T> type, Serializable id)
GeneralDAOdeleteById in interface GeneralDAOtype - Entity type.id - Id of the instance to delete.public <T> List<T> findAll(Class<T> type)
GeneralDAOfindAll in interface GeneralDAOtype - Entity type.public <T> T findById(Class<T> type, Serializable id, boolean lock)
GeneralDAOfindById in interface GeneralDAOtype - Entity type.id - ID.lock - If the entity shall be locked.null if it is not found.public void save(Object entity)
GeneralDAOsave in interface GeneralDAOentity - Entity to save.public void saveOrUpdate(Object entity)
GeneralDAOsaveOrUpdate in interface GeneralDAOentity - Entity to persist.public void update(Object entity)
GeneralDAOupdate in interface GeneralDAOentity - Entity to update.Copyright © 2014. All rights reserved.