C
- Entity type.R
- Result type.public interface Criteria<C,R>
Modifier and Type | Method and Description |
---|---|
<P extends Comparable<? super P>> |
between(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
P lower,
P upper)
Between predicate.
|
javax.persistence.TypedQuery<R> |
createQuery()
Creates a JPA query object to be executed.
|
Criteria<C,R> |
distinct()
Apply a distinct on the query.
|
<P extends Collection<?>> |
empty(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
Empty predicate.
|
<P> Criteria<C,R> |
eq(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
P value)
Equals predicate.
|
<P,E> Criteria<C,R> |
fetch(javax.persistence.metamodel.PluralAttribute<? super C,P,E> att)
Fetch join an attribute.
|
<P,E> Criteria<C,R> |
fetch(javax.persistence.metamodel.PluralAttribute<? super C,P,E> att,
javax.persistence.criteria.JoinType joinType)
Fetch join an attribute.
|
<P,E> Criteria<C,R> |
fetch(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
Fetch join an attribute.
|
<P,E> Criteria<C,R> |
fetch(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
javax.persistence.criteria.JoinType joinType)
Fetch join an attribute.
|
R |
getAnyResult()
Executes the query and returns a single result.
|
R |
getOptionalResult()
Executes the query which has a single result.
|
List<R> |
getResultList()
Executes the query and returns the result list.
|
R |
getSingleResult()
Executes the query which has a single result.
|
<P extends Comparable<? super P>> |
gt(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
P value)
Greater than predicate.
|
<P extends Comparable<? super P>> |
gtOrEq(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
P value)
Greater than or equals predicate.
|
<P> Criteria<C,R> |
in(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
P... values)
In predicte.
|
<P> Criteria<C,R> |
isNull(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
IsNull predicate.
|
<P,E> Criteria<C,R> |
join(javax.persistence.metamodel.CollectionAttribute<? super C,P> att,
Criteria<P,P> criteria)
Join a collection attribute with another Criteria.
|
<P,E> Criteria<C,R> |
join(javax.persistence.metamodel.ListAttribute<? super C,P> att,
Criteria<P,P> criteria)
Join a collection attribute with another Criteria.
|
<P,E> Criteria<C,R> |
join(javax.persistence.metamodel.MapAttribute<? super C,E,P> att,
Criteria<P,P> criteria)
Join a collection attribute with another Criteria.
|
<P,E> Criteria<C,R> |
join(javax.persistence.metamodel.SetAttribute<? super C,P> att,
Criteria<P,P> criteria)
Join a collection attribute with another Criteria.
|
<P,E> Criteria<C,R> |
join(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
Criteria<P,P> criteria)
Join an attribute with another Criteria.
|
<P> Criteria<C,R> |
like(javax.persistence.metamodel.SingularAttribute<? super C,String> att,
String value)
Like predicate.
|
<P extends Comparable<? super P>> |
lt(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
P value)
Less than predicate.
|
<P extends Comparable<? super P>> |
ltOrEq(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
P value)
Less than or equals predicate.
|
<P extends Collection<?>> |
notEmpty(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
Not empty predicate.
|
<P> Criteria<C,R> |
notEq(javax.persistence.metamodel.SingularAttribute<? super C,P> att,
P value)
Not Equals predicate.
|
<P> Criteria<C,R> |
notLike(javax.persistence.metamodel.SingularAttribute<? super C,String> att,
String value)
Not like predicate.
|
<P> Criteria<C,R> |
notNull(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
NotNull predicate.
|
Criteria<C,R> |
or(Collection<Criteria<C,R>> criteria)
Boolean OR with another Criteria.
|
Criteria<C,R> |
or(Criteria<C,R>... criteria)
Boolean OR with another Criteria.
|
<P> Criteria<C,R> |
orderAsc(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
Apply sorting by an attribute, ascending direction.
|
<P> Criteria<C,R> |
orderDesc(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
Apply sorting by an attribute, descending direction.
|
List<javax.persistence.criteria.Predicate> |
predicates(javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.Path<C> path)
Return the list of predicates applicable for this Criteria instance.
|
<N> Criteria<C,N> |
select(Class<N> resultClass,
QuerySelection<? super C,?>... selection)
Create a select query.
|
Criteria<C,Object[]> |
select(QuerySelection<? super C,?>... selection)
Create a select query.
|
List<R> getResultList()
R getSingleResult()
R getOptionalResult()
null
if there is no result.null
if there is none.R getAnyResult()
javax.persistence.TypedQuery<R> createQuery()
TypedQuery
object ready to return results.Criteria<C,R> or(Criteria<C,R>... criteria)
criteria
- The right side of the boolean OR.Criteria<C,R> or(Collection<Criteria<C,R>> criteria)
criteria
- The right side of the boolean OR.<P,E> Criteria<C,R> join(javax.persistence.metamodel.SingularAttribute<? super C,P> att, Criteria<P,P> criteria)
att
- The attribute to join.criteria
- The join criteria.<P,E> Criteria<C,R> join(javax.persistence.metamodel.ListAttribute<? super C,P> att, Criteria<P,P> criteria)
att
- The attribute to join.criteria
- The join criteria.<P,E> Criteria<C,R> join(javax.persistence.metamodel.CollectionAttribute<? super C,P> att, Criteria<P,P> criteria)
att
- The attribute to join.criteria
- The join criteria.<P,E> Criteria<C,R> join(javax.persistence.metamodel.SetAttribute<? super C,P> att, Criteria<P,P> criteria)
att
- The attribute to join.criteria
- The join criteria.<P,E> Criteria<C,R> join(javax.persistence.metamodel.MapAttribute<? super C,E,P> att, Criteria<P,P> criteria)
att
- The attribute to join.criteria
- The join criteria.<P,E> Criteria<C,R> fetch(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
att
- The attribute to fetch.<P,E> Criteria<C,R> fetch(javax.persistence.metamodel.SingularAttribute<? super C,P> att, javax.persistence.criteria.JoinType joinType)
att
- The attribute to fetch.joinType
- The JoinType to use.<P,E> Criteria<C,R> fetch(javax.persistence.metamodel.PluralAttribute<? super C,P,E> att)
att
- The attribute to fetch.<P,E> Criteria<C,R> fetch(javax.persistence.metamodel.PluralAttribute<? super C,P,E> att, javax.persistence.criteria.JoinType joinType)
att
- The attribute to fetch.joinType
- The JoinType to use.<P> Criteria<C,R> orderAsc(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
att
- The attribute to order for.<P> Criteria<C,R> orderDesc(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
att
- The attribute to order for.<N> Criteria<C,N> select(Class<N> resultClass, QuerySelection<? super C,?>... selection)
resultClass
- The query result class.selection
- List of selects (attributes, scalars...)Criteria<C,Object[]> select(QuerySelection<? super C,?>... selection)
selection
- List of selects (attributes, scalars...)Criteria<C,R> distinct()
<P> Criteria<C,R> eq(javax.persistence.metamodel.SingularAttribute<? super C,P> att, P value)
att
- The attribute to compare with.value
- The comparison value.<P> Criteria<C,R> notEq(javax.persistence.metamodel.SingularAttribute<? super C,P> att, P value)
att
- The attribute to compare with.value
- The comparison value.<P> Criteria<C,R> like(javax.persistence.metamodel.SingularAttribute<? super C,String> att, String value)
att
- The attribute to compare with.value
- The comparison value.<P> Criteria<C,R> notLike(javax.persistence.metamodel.SingularAttribute<? super C,String> att, String value)
att
- The attribute to compare with.value
- The comparison value.<P extends Comparable<? super P>> Criteria<C,R> lt(javax.persistence.metamodel.SingularAttribute<? super C,P> att, P value)
att
- The attribute to compare with.value
- The comparison value.<P extends Comparable<? super P>> Criteria<C,R> ltOrEq(javax.persistence.metamodel.SingularAttribute<? super C,P> att, P value)
att
- The attribute to compare with.value
- The comparison value.<P extends Comparable<? super P>> Criteria<C,R> gt(javax.persistence.metamodel.SingularAttribute<? super C,P> att, P value)
att
- The attribute to compare with.value
- The comparison value.<P extends Comparable<? super P>> Criteria<C,R> gtOrEq(javax.persistence.metamodel.SingularAttribute<? super C,P> att, P value)
att
- The attribute to compare with.value
- The comparison value.<P extends Comparable<? super P>> Criteria<C,R> between(javax.persistence.metamodel.SingularAttribute<? super C,P> att, P lower, P upper)
att
- The attribute to compare with.lower
- The lower bound comparison value.upper
- The upper bound comparison value.<P> Criteria<C,R> isNull(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
att
- The null attribute.<P> Criteria<C,R> notNull(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
att
- The non-null attribute.<P extends Collection<?>> Criteria<C,R> empty(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
att
- The collection attribute to check for emptyness.<P extends Collection<?>> Criteria<C,R> notEmpty(javax.persistence.metamodel.SingularAttribute<? super C,P> att)
att
- The collection attribute to check for non-emptyness.<P> Criteria<C,R> in(javax.persistence.metamodel.SingularAttribute<? super C,P> att, P... values)
att
- The attribute to check for.values
- The values for the in predicate.List<javax.persistence.criteria.Predicate> predicates(javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Path<C> path)
builder
- A CriteriaBuilder used to instantiate the Predicates.path
- Current path.Copyright © 2015 The Apache Software Foundation. All rights reserved.