|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.gov.frameworkdemoiselle.template.JPACrud<T,I>
T - bean object typeI - bean id typepublic class JPACrud<T,I>
JPA specific implementation for Crud interface.
Crud,
Serialized Form| Constructor Summary | |
|---|---|
JPACrud()
|
|
| Method Summary | |
|---|---|
protected javax.persistence.criteria.CriteriaQuery<T> |
createCriteriaQuery()
|
protected javax.persistence.Query |
createQuery(String ql)
|
void |
delete(I id)
|
List<T> |
findAll()
|
protected List<T> |
findByCriteriaQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
Search CriteriaQuery integrated into the context of paging |
protected List<T> |
findByExample(T example)
Retrieves a list of entities based on a single example instance of it. |
protected List<T> |
findByJPQL(String jpql)
Search JPQL integrated into the context of paging |
protected Class<T> |
getBeanClass()
|
protected javax.persistence.criteria.CriteriaBuilder |
getCriteriaBuilder()
|
protected javax.persistence.EntityManager |
getEntityManager()
|
protected Pagination |
getPagination()
|
protected void |
handleException(Throwable cause)
|
void |
insert(T entity)
|
T |
load(I id)
|
void |
update(T entity)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JPACrud()
| Method Detail |
|---|
protected Class<T> getBeanClass()
protected javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
protected javax.persistence.EntityManager getEntityManager()
protected Pagination getPagination()
protected javax.persistence.criteria.CriteriaQuery<T> createCriteriaQuery()
protected javax.persistence.Query createQuery(String ql)
protected void handleException(Throwable cause)
throws Throwable
Throwablepublic void insert(T entity)
insert in interface Crud<T,I>public void delete(I id)
delete in interface Crud<T,I>public void update(T entity)
update in interface Crud<T,I>public T load(I id)
load in interface Crud<T,I>public List<T> findAll()
findAll in interface Crud<T,I>protected List<T> findByJPQL(String jpql)
jpql - - query in syntax JPQL
protected List<T> findByCriteriaQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
criteriaQuery - - structure CriteriaQuery
protected List<T> findByExample(T example)
See below a sample of its usage:
Employee example = new Employee(); example.setId(12345); return (List<Employee>) findByExample(example);
example - an entity example
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||