public interface QueryDefinition extends Subquery
Modifier and Type | Method and Description |
---|---|
DomainObject |
addRoot(java.lang.Class cls)
Add a query root corresponding to the given entity, forming a cartesian
product with any existing roots.
|
DomainObject |
addSubqueryRoot(PathExpression path)
Add a root derived from a domain object of the containing query
definition to a query definition used as a subquery.
|
Subquery |
all()
Use the query definition object in a subquery in an all expression.
|
Subquery |
any()
Use the query definition object in a subquery in an any expression.
|
Expression |
coalesce(java.util.Calendar... exp)
coalesce This is equivalent to a case expression that returns null if all
its arguments evaluate to null, and the value of its first non-null
argument otherwise.
|
Expression |
coalesce(java.util.Date... exp)
coalesce This is equivalent to a case expression that returns null if all
its arguments evaluate to null, and the value of its first non-null
argument otherwise.
|
Expression |
coalesce(Expression... exp)
coalesce This is equivalent to a case expression that returns null if all
its arguments evaluate to null, and the value of its first non-null
argument otherwise.
|
Expression |
coalesce(java.lang.String... exp)
coalesce This is equivalent to a case expression that returns null if all
its arguments evaluate to null, and the value of its first non-null
argument otherwise.
|
Expression |
currentDate()
Create an Expression corresponding to the current date on the database
server at the time of query execution.
|
Expression |
currentTime()
Create an Expression corresponding to the current time on the database
server at the time of query execution.
|
Expression |
currentTimestamp()
Create an Expression corresponding to the current timestamp on the
database server at the time of query execution.
|
Predicate |
exists()
Use the query definition instance as a subquery in an exists predicate.
|
CaseExpression |
generalCase()
Create an empty general case expression.
|
QueryDefinition |
groupBy(java.util.List<PathExpression> pathExprList)
Specify the items that are used to form groups over the query results.
|
QueryDefinition |
groupBy(PathExpression... pathExprs)
Specify the items that are used to form groups over the query results.
|
QueryDefinition |
having(Predicate predicate)
Specify the restrictions over the groups of a query.
|
Expression |
literal(boolean b)
Create an Expression corresponding to a boolean value.
|
Expression |
literal(java.util.Calendar c)
Create an Expression corresponding to a Calendar value.
|
Expression |
literal(char c)
Create an Expression corresponding to a character value.
|
Expression |
literal(java.lang.Class cls)
Create an Expression corresponding to an entity class.
|
Expression |
literal(java.util.Date d)
Create an Expression corresponding to a Date value.
|
Expression |
literal(java.lang.Enum<?> e)
Create an Expression corresponding to an enum.
|
Expression |
literal(java.lang.Number n)
Create an Expression corresponding to a numeric value.
|
Expression |
literal(java.lang.String s)
Create an Expression corresponding to a String value.
|
SelectItem |
newInstance(java.lang.Class cls,
SelectItem... args)
Specify that a constructor for the given class is to be applied to the
corresponding query results after the query is executed.
|
Expression |
nullif(java.util.Calendar arg1,
java.util.Calendar arg2)
nullif This is equivalent to a case expression that tests whether its
arguments are equal, returning null if they are and the value of the
first expression if they are not.
|
Expression |
nullif(java.lang.Class arg1,
java.lang.Class arg2)
nullif This is equivalent to a case expression that tests whether its
arguments are equal, returning null if they are and the value of the
first expression if they are not.
|
Expression |
nullif(java.util.Date arg1,
java.util.Date arg2)
nullif This is equivalent to a case expression that tests whether its
arguments are equal, returning null if they are and the value of the
first expression if they are not.
|
Expression |
nullif(java.lang.Enum<?> arg1,
java.lang.Enum<?> arg2)
nullif This is equivalent to a case expression that tests whether its
arguments are equal, returning null if they are and the value of the
first expression if they are not.
|
Expression |
nullif(Expression exp1,
Expression exp2)
nullif This is equivalent to a case expression that tests whether its
arguments are equal, returning null if they are and the value of the
first expression if they are not.
|
Expression |
nullif(java.lang.Number arg1,
java.lang.Number arg2)
nullif This is equivalent to a case expression that tests whether its
arguments are equal, returning null if they are and the value of the
first expression if they are not.
|
Expression |
nullif(java.lang.String arg1,
java.lang.String arg2)
nullif This is equivalent to a case expression that tests whether its
arguments are equal, returning null if they are and the value of the
first expression if they are not.
|
Expression |
nullLiteral()
Create an Expression corresponding to a null value.
|
QueryDefinition |
orderBy(java.util.List<OrderByItem> orderByItemList)
Specify the items of the select list that are used in ordering the query
results.
|
QueryDefinition |
orderBy(OrderByItem... orderByItems)
Specify the items of the select list that are used in ordering the query
results.
|
Expression |
param(java.lang.String name)
Specify use of a parameter of the given name.
|
Predicate |
predicate(boolean b)
Create a predicate value from the given boolean.
|
QueryDefinition |
select(java.util.List<SelectItem> selectItemList)
Specify the objects / values to be returned.
|
QueryDefinition |
select(SelectItem... selectItems)
Specify the objects / values to be returned.
|
QueryDefinition |
selectDistinct(java.util.List<SelectItem> selectItemList)
Specify the objects / values to be returned.
|
QueryDefinition |
selectDistinct(SelectItem... selectItems)
Specify the objects / values to be returned.
|
CaseExpression |
simpleCase(java.util.Calendar caseOperand)
Create a simple case expression with the given case operand.
|
CaseExpression |
simpleCase(java.lang.Class caseOperand)
Create a simple case expression with the given case operand.
|
CaseExpression |
simpleCase(java.util.Date caseOperand)
Create a simple case expression with the given case operand.
|
CaseExpression |
simpleCase(java.lang.Enum<?> caseOperand)
Create a simple case expression with the given case operand.
|
CaseExpression |
simpleCase(Expression caseOperand)
Create a simple case expression with the given case operand.
|
CaseExpression |
simpleCase(java.lang.Number caseOperand)
Create a simple case expression with the given case operand.
|
CaseExpression |
simpleCase(java.lang.String caseOperand)
Create a simple case expression with the given case operand.
|
Subquery |
some()
Use the query definition object in a subquery in a some expression.
|
QueryDefinition |
where(Predicate predicate)
Modifies the query definition to restrict the result of the query
according to the specified predicate.
|
between, between, between, between, between, between, between, between, between, between, between, between, between, equal, equal, equal, equal, equal, equal, equal, equal, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessThan, lessThan, lessThan, lessThan, lessThan, like, like, like, like, like, like, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual
DomainObject addRoot(java.lang.Class cls)
cls
- -
an entity classDomainObject addSubqueryRoot(PathExpression path)
path
- -
path expression corresponding to the domain object used to
derive the subquery root.QueryDefinition select(SelectItem... selectItems)
selectItems
- -
one or more SelectItem instancesQueryDefinition select(java.util.List<SelectItem> selectItemList)
selectItemList
- -
a list containing one or more SelectItem instancesQueryDefinition selectDistinct(SelectItem... selectItems)
selectItems
- -
one or more SelectItem instancesQueryDefinition selectDistinct(java.util.List<SelectItem> selectItemList)
selectItemList
- -
a list containing one or more SelectItem instancesQueryDefinition where(Predicate predicate)
predicate
- -
a simple or compound conditional predicateQueryDefinition orderBy(OrderByItem... orderByItems)
orderByItems
- -
one or more OrderByItem instancesQueryDefinition orderBy(java.util.List<OrderByItem> orderByItemList)
orderByItemList
- -
a list containing one or more OrderByItem
instancesQueryDefinition groupBy(PathExpression... pathExprs)
pathExprs
- QueryDefinition groupBy(java.util.List<PathExpression> pathExprList)
pathExprList
- QueryDefinition having(Predicate predicate)
predicate
- SelectItem newInstance(java.lang.Class cls, SelectItem... args)
cls
- -
a class with the correponding constructorargs
- -
select items that correspond to result types that are valid
as arguments to the constructorPredicate exists()
Subquery all()
Subquery any()
Subquery some()
CaseExpression generalCase()
CaseExpression simpleCase(Expression caseOperand)
caseOperand
- -
expression used for testing against the when scalar
expressionsCaseExpression simpleCase(java.lang.Number caseOperand)
caseOperand
- -
numeric value used for testing against the when scalar
expressionsCaseExpression simpleCase(java.lang.String caseOperand)
caseOperand
- -
value used for testing against the when scalar
expressionsCaseExpression simpleCase(java.util.Date caseOperand)
caseOperand
- -
value used for testing against the when scalar
expressionsCaseExpression simpleCase(java.util.Calendar caseOperand)
caseOperand
- -
value used for testing against the when scalar
expressionsCaseExpression simpleCase(java.lang.Class caseOperand)
caseOperand
- -
value used for testing against the when scalar
expressionsCaseExpression simpleCase(java.lang.Enum<?> caseOperand)
caseOperand
- -
value used for testing against the when scalar
expressionsExpression coalesce(Expression... exp)
exp
- -
expressions to be used for testing against nullExpression coalesce(java.lang.String... exp)
exp
- -
expressions to be used for testing against nullExpression coalesce(java.util.Date... exp)
exp
- -
expressions to be used for testing against nullExpression coalesce(java.util.Calendar... exp)
exp
- -
expressions to be used for testing against nullExpression nullif(Expression exp1, Expression exp2)
exp1
- exp2
- Expression nullif(java.lang.Number arg1, java.lang.Number arg2)
arg1
- arg2
- Expression nullif(java.lang.String arg1, java.lang.String arg2)
arg1
- arg2
- Criteria API Java Persistence 2.0, Public Review Draft
Criteria API Interfaces 10/31/08 158 JSR-317 Public Review
Draft Sun Microsystems, Inc.Expression nullif(java.util.Date arg1, java.util.Date arg2)
arg1
- arg2
- Expression nullif(java.util.Calendar arg1, java.util.Calendar arg2)
arg1
- arg2
- Expression nullif(java.lang.Class arg1, java.lang.Class arg2)
arg1
- arg2
- Expression nullif(java.lang.Enum<?> arg1, java.lang.Enum<?> arg2)
arg1
- arg2
- Predicate predicate(boolean b)
b
- boolean valueExpression currentTime()
Expression currentDate()
Expression currentTimestamp()
Expression literal(java.lang.String s)
s
- -
string valueExpression literal(java.lang.Number n)
n
- -
numeric valueExpression literal(boolean b)
b
- -
boolean valueExpression literal(java.util.Calendar c)
c
- -
Calendar valueExpression literal(java.util.Date d)
d
- -
Date valueExpression literal(char c)
character
- valueExpression literal(java.lang.Class cls)
cls
- -
entity classExpression literal(java.lang.Enum<?> e)
e
- -
enumExpression nullLiteral()
Expression param(java.lang.String name)
parameter
- name