Class SearchType<X>
java.lang.Object
org.dellroad.querystream.jpa.querytype.QueryType<X,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>
org.dellroad.querystream.jpa.querytype.SearchType<X>
- Type Parameters:
X
- query result type
Represents the JPA Criteria API search query type.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateCriteriaQuery
(CriteriaBuilder builder) Create a new Criteria API query object of the appropriate type.createQuery
(EntityManager entityManager, CriteriaQuery<X> query) Create a JPA query object of the appropriate type.select
(CriteriaQuery<X> query, Selection<X> expression) Configure the result expression associated with a query.void
where
(AbstractQuery<?> query, Expression<Boolean> restriction) Configure the restriction associated with the given query.void
where
(AbstractQuery<?> query, Predicate restriction) Configure the restriction associated with the given query.
-
Constructor Details
-
SearchType
Constructor.- Parameters:
type
- query result type- Throws:
IllegalArgumentException
- iftype
is null
-
-
Method Details
-
createCriteriaQuery
Description copied from class:QueryType
Create a new Criteria API query object of the appropriate type.- Specified by:
createCriteriaQuery
in classQueryType<X,
AbstractQuery<?>, CriteriaQuery<X>, TypedQuery<X>> - Parameters:
builder
- criteria builder- Returns:
- new criteria query object
-
createQuery
Description copied from class:QueryType
Create a JPA query object of the appropriate type.- Specified by:
createQuery
in classQueryType<X,
AbstractQuery<?>, CriteriaQuery<X>, TypedQuery<X>> - Parameters:
entityManager
- JPA entity managerquery
- criteria query object- Returns:
- new executable JPA query object
-
where
Description copied from class:QueryType
Configure the restriction associated with the given query.- Specified by:
where
in classQueryType<X,
AbstractQuery<?>, CriteriaQuery<X>, TypedQuery<X>> - Parameters:
query
- criteria query objectrestriction
- query restriction
-
where
Description copied from class:QueryType
Configure the restriction associated with the given query.- Specified by:
where
in classQueryType<X,
AbstractQuery<?>, CriteriaQuery<X>, TypedQuery<X>> - Parameters:
query
- criteria query objectrestriction
- query restriction
-
select
Configure the result expression associated with a query.- Parameters:
query
- criteria query objectexpression
- query result- Returns:
- updated criteria query object
-