public class TypedJpaDao<E extends Entity<I>,I> extends GenericJpaDao implements TypedDao<E,I>
TypedDao that uses a JPA EntityManager.| Modifier and Type | Field and Description |
|---|---|
protected Class<E> |
entityClass |
| Constructor and Description |
|---|
TypedJpaDao(Class<E> entityClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(E entity)
Deletes the given Entity.
|
void |
delete(I id)
Deletes the entity with the given id.
|
E |
find(I id)
Finds the entity with the given id.
|
List<E> |
findAll()
Finds all entities.
|
List<E> |
findAll(Collection<PredicateBuilder<E>> filters)
Finds all entities that match all predicates generated by the given
PredicateBuilder s. |
List<E> |
findAll(PredicateBuilder<E>... filters)
Finds all entities that match all predicates generated by the given
PredicateBuilder s. |
List<E> |
findAll(PredicateBuilder<E> filter)
Finds all entities that match all predicates generated by the given
PredicateBuilder s. |
List<E> |
findAll(javax.persistence.metamodel.SingularAttribute<? super E,?> attribute,
boolean asc)
Finds all entities ordered by the given attribute and the given sort order.
|
List<E> |
findAll(javax.persistence.metamodel.SingularAttribute<? super E,?> attribute,
boolean asc,
int firstResult,
int maxResults)
Finds all entities ordered by the given attribute and the given sort order with the result set limit to the given
size.
|
long |
getCount()
Get the total number of entities in this Dao.
|
E |
load(I id)
Loads the entity with the given id or throws an Exception if it was not found.
|
delete, delete, find, find, find, find, findAll, findFirstOrNull, findSingle, findSingleOrNull, getCount, getCriteriaBuilder, getEntityManager, getLogger, load, save, setEntityManager, setLogger@Transactional(propagation=MANDATORY) public void delete(E entity)
TypedDao@Transactional(propagation=MANDATORY) public void delete(I id)
TypedDao@Transactional(propagation=MANDATORY,
readOnly=true)
public E find(I id)
TypedDao@Transactional(propagation=MANDATORY,
readOnly=true)
public long getCount()
TypedDao@Transactional(propagation=MANDATORY,
readOnly=true)
public E load(I id)
TypedDao@Transactional(propagation=MANDATORY,
readOnly=true)
public List<E> findAll()
TypedDao@Transactional(propagation=MANDATORY,
readOnly=true)
public List<E> findAll(javax.persistence.metamodel.SingularAttribute<? super E,?> attribute,
boolean asc)
TypedDao@Transactional(propagation=MANDATORY,
readOnly=true)
public List<E> findAll(javax.persistence.metamodel.SingularAttribute<? super E,?> attribute,
boolean asc,
int firstResult,
int maxResults)
TypedDao@Transactional(propagation=MANDATORY,
readOnly=true)
public List<E> findAll(PredicateBuilder<E> filter)
TypedDaoPredicateBuilder s.@Transactional(propagation=MANDATORY,
readOnly=true)
public List<E> findAll(Collection<PredicateBuilder<E>> filters)
TypedDaoPredicateBuilder s.@Transactional(propagation=MANDATORY,
readOnly=true)
public List<E> findAll(PredicateBuilder<E>... filters)
TypedDaoPredicateBuilder s.Copyright © 2014 dontdrinkandroot. All rights reserved.