public interface CommonAbstractQuery
CommonAbstractQuery
interface defines functionality that is
common to both top-level queries and subqueries as well as to update and
delete criteria operations.
It is not intended to be used directly in query construction.
All queries must have: a set of root entities (which may in turn own joins).
All queries may have: a conjunction of restrictions.
Note that criteria queries and criteria update and delete operations are typed differently. Criteria queries are typed according to the query result type. Update and delete operations are typed according to the target of the update or delete.
Modifier and Type | Method and Description |
---|---|
<X> Root<X> |
from(java.lang.Class<X> entityClass)
Create and add a query root corresponding to the given entity.
|
<X> Root<X> |
from(EntityType<X> entity)
Create and add a query root corresponding to the given entity,
|
Predicate |
getRestriction()
Return the predicate that corresponds to the where clause
restriction(s), or null if no restrictions have been
specified.
|
<U> Subquery<U> |
subquery(java.lang.Class<U> type)
Create a subquery of the query.
|
CommonAbstractQuery |
where(Expression<java.lang.Boolean> restriction)
Modify the query to restrict the query results according
to the specified boolean expression.
|
CommonAbstractQuery |
where(Predicate... restrictions)
Modify the query to restrict the query results according
to the conjunction of the specified restriction predicates.
|
<X> Root<X> from(java.lang.Class<X> entityClass)
entityClass
- the entity class<X> Root<X> from(EntityType<X> entity)
entity
- metamodel entity representing the entity
of type XCommonAbstractQuery where(Expression<java.lang.Boolean> restriction)
restriction
- a simple or compound boolean expressionCommonAbstractQuery where(Predicate... restrictions)
restrictions
- zero or more restriction predicates<U> Subquery<U> subquery(java.lang.Class<U> type)
type
- the subquery result typePredicate getRestriction()
Copyright © 2009-2013, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.