E - public abstract class BasicDao<E> extends Object implements Listable<E>, Savable, Removable
| Constructor and Description |
|---|
BasicDao(Class<?> entityClass,
SessionConfigAbstract sessionConfig)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCriterion(org.hibernate.criterion.Criterion criterion)
Add a search criterion
|
void |
addOrder(String value)
Add a parameter to sorting the research
|
void |
addOrder(String value,
boolean desc)
Add a parameter to sorting the research
|
void |
clear()
Clear all object
|
boolean |
equals(Object obj) |
int |
hashCode() |
List<E> |
list()
Entities list by research criterions and order fields.
|
boolean |
remove(Entitable entity)
Remove an entity permanently
|
boolean |
remove(LogicDeletable entity,
boolean logical)
Remove a entity setting the deleted attribute with true.
|
boolean |
save(Entitable entity)
Insert or update a entity
|
E |
single()
Return a single entity by research criterions
|
String |
toString() |
public BasicDao(Class<?> entityClass, SessionConfigAbstract sessionConfig)
entityClass - inform the class of the entitysessionConfig - set the class that implements the Hibernate session
factory configurationpublic void addOrder(String value)
Listablepublic void addOrder(String value, boolean desc)
Listablepublic void addCriterion(org.hibernate.criterion.Criterion criterion)
ListableaddCriterion in interface Listable<E>criterion - hibernate criterionCriterionpublic List<E> list() throws org.hibernate.HibernateException, Exception
Listablepublic E single() throws org.hibernate.HibernateException, Exception
Listablepublic boolean save(Entitable entity) throws org.hibernate.HibernateException, Exception
Savablepublic boolean remove(Entitable entity) throws org.hibernate.exception.ConstraintViolationException, org.hibernate.HibernateException, Exception
Removablepublic boolean remove(LogicDeletable entity, boolean logical) throws org.hibernate.exception.ConstraintViolationException, org.hibernate.HibernateException, Exception
Removableremove in interface Removableentity - the entity that will be removedlogical - sets true if this remove action is of the logical wayorg.hibernate.exception.ConstraintViolationExceptionorg.hibernate.HibernateExceptionExceptionpublic void clear()
ClearableCopyright © 2016. All rights reserved.