X - query result/target typeC - configured criteria API query typeC2 - final criteria API query typeQ - final JPA query typepublic abstract class QueryType<X,C extends CommonAbstractCriteria,C2 extends C,Q extends Query> extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
QueryType(Class<X> type)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract C2 |
createCriteriaQuery(CriteriaBuilder builder)
Create a new Criteria API query object of the appropriate type.
|
abstract Q |
createQuery(EntityManager entityManager,
C2 query)
Create a JPA query object of the appropriate type.
|
Class<X> |
getType()
Get the query result/target type associated with this instance.
|
abstract void |
where(C query,
Expression<Boolean> restriction)
Configure the restriction associated with the given query.
|
abstract void |
where(C query,
Predicate restriction)
Configure the restriction associated with the given query.
|
protected QueryType(Class<X> type)
type - query result/target typeIllegalArgumentException - if type is nullpublic Class<X> getType()
public abstract C2 createCriteriaQuery(CriteriaBuilder builder)
builder - criteria builderIllegalArgumentException - if builder is nullpublic abstract Q createQuery(EntityManager entityManager, C2 query)
entityManager - JPA entity managerquery - criteria query objectIllegalArgumentException - if entityManager or query is nullpublic abstract void where(C query, Expression<Boolean> restriction)
query - criteria query objectrestriction - query restrictionIllegalArgumentException - if query or expression is nullpublic abstract void where(C query, Predicate restriction)
query - criteria query objectrestriction - query restrictionIllegalArgumentException - if query or expression is nullCopyright © 2023. All rights reserved.