public abstract class JPARepository<T> extends Object implements Repository<T,JPASpecification<T>>
| Constructor and Description |
|---|
JPARepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T element)
Add an element
|
long |
count(JPASpecification<T> specification)
Count elements that matches a given specification
|
List<T> |
find(JPASpecification<T> specification,
Integer maxResult,
Integer offset,
Sort... sorts)
Get elements that matches a given specification
|
List<T> |
find(JPASpecification<T> specification,
Integer maxResult,
Sort... sorts)
Get elements that matches a given specification
|
List<T> |
find(JPASpecification<T> specification,
Sort... sorts)
Get elements that matches a given specification
|
T |
first(JPASpecification<T> specification,
Sort... sorts)
Get the first element that matches a given specification
|
abstract javax.persistence.EntityManager |
getEntityManager() |
abstract Class<T> |
getType() |
void |
remove(T element)
Removes element
|
void |
update(T element)
Updates element
|
public void add(T element)
Repositoryadd in interface Repository<T,JPASpecification<T>>element - to be addedpublic void remove(T element)
Repositoryremove in interface Repository<T,JPASpecification<T>>element - element to be removedpublic void update(T element)
Repositoryupdate in interface Repository<T,JPASpecification<T>>element - new elementpublic List<T> find(JPASpecification<T> specification, Sort... sorts)
Repositoryfind in interface Repository<T,JPASpecification<T>>specification - a query specificationsorts - specify one or more attributes that should be used to sort the resultpublic List<T> find(JPASpecification<T> specification, Integer maxResult, Sort... sorts)
Repositoryfind in interface Repository<T,JPASpecification<T>>specification - a query specificationmaxResult - an upper limit to the number of elements returned in the resultsorts - specify one or more attributes that should be used to sort the resultpublic List<T> find(JPASpecification<T> specification, Integer maxResult, Integer offset, Sort... sorts)
Repositoryfind in interface Repository<T,JPASpecification<T>>specification - a query specificationmaxResult - an upper limit to the number of elements returned in the resultoffset - the position of the first result to retrieve.sorts - specify one or more attributes that should be used to sort the resultpublic long count(JPASpecification<T> specification)
Repositorycount in interface Repository<T,JPASpecification<T>>specification - a query specificationpublic T first(JPASpecification<T> specification, Sort... sorts)
Repositoryfirst in interface Repository<T,JPASpecification<T>>specification - a query specificationsorts - specify one or more attributes that should be used to sort the resultpublic abstract javax.persistence.EntityManager getEntityManager()
Copyright © 2019. All rights reserved.