org.apache.openjpa.persistence.query
Class AbstractDomainObject

java.lang.Object
  extended by org.apache.openjpa.persistence.query.AbstractVisitable
      extended by org.apache.openjpa.persistence.query.ExpressionImpl
          extended by org.apache.openjpa.persistence.query.AbstractPath
              extended by org.apache.openjpa.persistence.query.AbstractDomainObject
All Implemented Interfaces:
Serializable, DomainObject, Expression, OrderByItem, PathExpression, PredicateOperand, QueryDefinition, SelectItem, Subquery, Visitable
Direct Known Subclasses:
FetchPath, JoinPath, NavigationPath, OperatorPath, RootPath

public abstract class AbstractDomainObject
extends AbstractPath
implements DomainObject

Domain Object is a path expression over which query is evaluated. Domain object acts as a proxy for a QueryDefinition via delegation.

Author:
Pinaki Poddar
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.openjpa.persistence.query.AbstractPath
_operator, _owner, _parent, _part2
 
Fields inherited from class org.apache.openjpa.persistence.query.AbstractVisitable
CLOSE_BRACE, COMMA, EMPTY, OPEN_BRACE, SPACE
 
Constructor Summary
protected AbstractDomainObject(QueryDefinitionImpl owner, AbstractPath parent, PathOperator op, Object part2)
           
 
Method Summary
 DomainObject addRoot(Class cls)
          Adding a root adds a root domain to the owning query.
 DomainObject addSubqueryRoot(PathExpression path)
          Adding a query root adds a subquery to the owning query.
 Subquery all()
          Derives this path as ALL(subquery) to its owning query.
 Subquery any()
          Adds this path as ANY(subquery) to its owning query.
 Expression coalesce(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(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(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.
 SelectItem entry()
          Derives by ENTRY() operation on this path.
 Predicate exists()
          Adds this path as EXISTS(subquery) to its owning query.
 CaseExpression generalCase()
          Create an empty general case expression.
 PathExpression get(String attr)
          Derives a path from this path by navigating through the given field.
 QueryDefinition groupBy(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 index()
          Derives by INDEX() operation on this path.
 DomainObject join(String attr)
          Derives a path from this path by joining the given field.
 FetchJoinObject joinFetch(String attr)
          Derives a path from this path by fetch joining the given field.
 PathExpression key()
          Derives by KEY() operation on this path.
 DomainObject leftJoin(String attr)
          Derives a path from this path by outer joining the given field.
 FetchJoinObject leftJoinFetch(String attr)
          Derives a path from this path by fetch joining the given field.
 Expression literal(boolean b)
          Create an Expression corresponding to a boolean value.
 Expression literal(Calendar c)
          Create an Expression corresponding to a Calendar value.
 Expression literal(char c)
          Create an Expression corresponding to a character value.
 Expression literal(Class cls)
          Create an Expression corresponding to an entity class.
 Expression literal(Date d)
          Create an Expression corresponding to a Date value.
 Expression literal(Enum<?> e)
          Create an Expression corresponding to an enum.
 Expression literal(Number n)
          Create an Expression corresponding to a numeric value.
 Expression literal(String s)
          Create an Expression corresponding to a String value.
 SelectItem newInstance(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(Calendar arg1, 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(Class arg1, 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(Date arg1, 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(Enum<?> arg1, 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(Number arg1, 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(String arg1, 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(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(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(List<SelectItem> selectItemList)
          Specify the objects / values to be returned.
 QueryDefinition select(SelectItem... selectItems)
          Specify the objects / values to be returned.
 QueryDefinition selectDistinct(List<SelectItem> selectItemList)
          Specify the objects / values to be returned.
 QueryDefinition selectDistinct(SelectItem... selectItems)
          Specify the objects / values to be returned.
 CaseExpression simpleCase(Calendar caseOperand)
          Create a simple case expression with the given case operand.
 CaseExpression simpleCase(Class caseOperand)
          Create a simple case expression with the given case operand.
 CaseExpression simpleCase(Date caseOperand)
          Create a simple case expression with the given case operand.
 CaseExpression simpleCase(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(Number caseOperand)
          Create a simple case expression with the given case operand.
 CaseExpression simpleCase(String caseOperand)
          Create a simple case expression with the given case operand.
 Subquery some()
          Adds this path as SOME(subquery) to its owning query.
 PathExpression value()
          Derives a path by VALUE() operation on this path.
 QueryDefinition where(Predicate predicate)
          Modifies the query definition to restrict the result of the query according to the specified predicate.
 
Methods inherited from class org.apache.openjpa.persistence.query.AbstractPath
avg, count, getLastSegment, getOperator, getOwner, getParent, isEmpty, max, min, size, split, sum, type
 
Methods inherited from class org.apache.openjpa.persistence.query.ExpressionImpl
abs, asc, between, between, between, between, between, between, between, between, between, between, between, between, between, concat, concat, desc, dividedBy, dividedBy, equal, equal, equal, equal, equal, equal, equal, equal, getAliasHint, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, in, in, in, in, in, in, isNull, length, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessThan, lessThan, lessThan, lessThan, lessThan, like, like, like, like, like, like, locate, locate, locate, locate, locate, locate, lower, member, minus, minus, minus, mod, mod, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, plus, plus, sqrt, substring, substring, substring, substring, substring, substring, times, times, trim, trim, trim, trim, trim, trim, upper
 
Methods inherited from class org.apache.openjpa.persistence.query.AbstractVisitable
asExpression, asJoinable, asProjection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.persistence.query.PathExpression
avg, count, isEmpty, max, min, size, sum, type
 
Methods inherited from interface org.apache.openjpa.persistence.query.Expression
abs, concat, concat, dividedBy, dividedBy, in, in, in, in, in, in, isNull, length, locate, locate, locate, locate, locate, locate, lower, member, minus, minus, minus, mod, mod, plus, plus, sqrt, substring, substring, substring, substring, substring, substring, times, times, trim, trim, trim, trim, trim, trim, upper
 
Methods inherited from interface org.apache.openjpa.persistence.query.SelectItem
asc, desc
 
Methods inherited from interface org.apache.openjpa.persistence.query.PredicateOperand
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
 
Methods inherited from interface org.apache.openjpa.persistence.query.Visitable
asExpression, asJoinable, asProjection
 

Constructor Detail

AbstractDomainObject

protected AbstractDomainObject(QueryDefinitionImpl owner,
                               AbstractPath parent,
                               PathOperator op,
                               Object part2)
Method Detail

addRoot

public DomainObject addRoot(Class cls)
Adding a root adds a root domain to the owning query.

Specified by:
addRoot in interface QueryDefinition
Parameters:
cls - - an entity class
Returns:
DomainObject corresponding to the specified entity class.

addSubqueryRoot

public DomainObject addSubqueryRoot(PathExpression path)
Adding a query root adds a subquery to the owning query.

Specified by:
addSubqueryRoot in interface QueryDefinition
Parameters:
path - - path expression corresponding to the domain object used to derive the subquery root.
Returns:
the subquery DomainObject

get

public PathExpression get(String attr)
Derives a path from this path by navigating through the given field.

Specified by:
get in interface PathExpression
Parameters:
attr - - name of the referenced attribute
Returns:
path expression

join

public DomainObject join(String attr)
Derives a path from this path by joining the given field. Also the joined path becomes a domain of the owning query.

Specified by:
join in interface DomainObject
Parameters:
attr - - name of the attribute that references the target of the join
Returns:
the new DomainObject that is added for the target of the join

leftJoin

public DomainObject leftJoin(String attr)
Derives a path from this path by outer joining the given field. Also the joined path becomes a domain of the owning query.

Specified by:
leftJoin in interface DomainObject
Parameters:
attr - - name of the attribute that references the target of the join
Returns:
the new DomainObject that is added for the target of the join

joinFetch

public FetchJoinObject joinFetch(String attr)
Derives a path from this path by fetch joining the given field.

Specified by:
joinFetch in interface DomainObject
Parameters:
attr - - name of the attribute that references the target of the join
Returns:
the FetchJoinObject that is added for the target of the join

leftJoinFetch

public FetchJoinObject leftJoinFetch(String attr)
Derives a path from this path by fetch joining the given field.

Specified by:
leftJoinFetch in interface DomainObject
Parameters:
attr - - name of the attribute that references the target of the join
Returns:
the FetchJoinObject that is added for the target of the join

key

public PathExpression key()
Derives by KEY() operation on this path.

Specified by:
key in interface DomainObject
Returns:
PathExpression corresponding to the map key

entry

public SelectItem entry()
Derives by ENTRY() operation on this path.

Specified by:
entry in interface DomainObject
Returns:
SelectItem corresponding to the map entry

index

public Expression index()
Derives by INDEX() operation on this path.

Specified by:
index in interface DomainObject
Returns:
Expression denoting the index

value

public PathExpression value()
Derives a path by VALUE() operation on this path.

Specified by:
value in interface DomainObject
Returns:
PathExpression corresponding to the map value

all

public Subquery all()
Derives this path as ALL(subquery) to its owning query.

Specified by:
all in interface QueryDefinition
Returns:
the resulting Subquery

any

public Subquery any()
Adds this path as ANY(subquery) to its owning query.

Specified by:
any in interface QueryDefinition
Returns:
the resulting Subquery

some

public Subquery some()
Adds this path as SOME(subquery) to its owning query.

Specified by:
some in interface QueryDefinition
Returns:
the resulting Subquery

exists

public Predicate exists()
Adds this path as EXISTS(subquery) to its owning query.

Specified by:
exists in interface QueryDefinition
Returns:
the resulting predicate

coalesce

public Expression coalesce(Expression... exp)
Description copied from interface: QueryDefinition
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.

Specified by:
coalesce in interface QueryDefinition
Parameters:
exp - - expressions to be used for testing against null
Returns:
Expression corresponding to the given coalesce expression

coalesce

public Expression coalesce(String... exp)
Description copied from interface: QueryDefinition
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.

Specified by:
coalesce in interface QueryDefinition
Parameters:
exp - - expressions to be used for testing against null
Returns:
Expression corresponding to the given coalesce expression

coalesce

public Expression coalesce(Date... exp)
Description copied from interface: QueryDefinition
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.

Specified by:
coalesce in interface QueryDefinition
Parameters:
exp - - expressions to be used for testing against null
Returns:
Expression corresponding to the given coalesce expression

coalesce

public Expression coalesce(Calendar... exp)
Description copied from interface: QueryDefinition
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.

Specified by:
coalesce in interface QueryDefinition
Parameters:
exp - - expressions to be used for testing against null
Returns:
Expression corresponding to the given coalesce expression

currentDate

public Expression currentDate()
Description copied from interface: QueryDefinition
Create an Expression corresponding to the current date on the database server at the time of query execution.

Specified by:
currentDate in interface QueryDefinition
Returns:
the corresponding Expression

currentTime

public Expression currentTime()
Description copied from interface: QueryDefinition
Create an Expression corresponding to the current time on the database server at the time of query execution.

Specified by:
currentTime in interface QueryDefinition
Returns:
the corresponding Expression

currentTimestamp

public Expression currentTimestamp()
Description copied from interface: QueryDefinition
Create an Expression corresponding to the current timestamp on the database server at the time of query execution.

Specified by:
currentTimestamp in interface QueryDefinition
Returns:
the corresponding Expression

generalCase

public CaseExpression generalCase()
Description copied from interface: QueryDefinition
Create an empty general case expression. A general case expression is of the form:

generalCase() .when(conditional-predicate).then(scalar-expression) .when(conditional-predicate).then(scalar-expression) ... .elseCase(scalar-expression)

Specified by:
generalCase in interface QueryDefinition
Returns:
empty general case expression

groupBy

public QueryDefinition groupBy(PathExpression... pathExprs)
Description copied from interface: QueryDefinition
Specify the items that are used to form groups over the query results. Replaces the previous group-by list, if any.

Specified by:
groupBy in interface QueryDefinition
Returns:
the modified QueryDefinition instance

groupBy

public QueryDefinition groupBy(List<PathExpression> pathExprList)
Description copied from interface: QueryDefinition
Specify the items that are used to form groups over the query results. Replaces the previous group-by list, if any.

Specified by:
groupBy in interface QueryDefinition
Returns:
the modified QueryDefinition instance

having

public QueryDefinition having(Predicate predicate)
Description copied from interface: QueryDefinition
Specify the restrictions over the groups of a query. Replaces the previous having restriction(s), if any.

Specified by:
having in interface QueryDefinition
Returns:
the modified QueryDefinition Instance

literal

public Expression literal(String s)
Description copied from interface: QueryDefinition
Create an Expression corresponding to a String value.

Specified by:
literal in interface QueryDefinition
Parameters:
s - - string value
Returns:
the corresponding Expression literal

literal

public Expression literal(Number n)
Description copied from interface: QueryDefinition
Create an Expression corresponding to a numeric value.

Specified by:
literal in interface QueryDefinition
Parameters:
n - - numeric value
Returns:
the corresponding Expression literal

literal

public Expression literal(boolean b)
Description copied from interface: QueryDefinition
Create an Expression corresponding to a boolean value.

Specified by:
literal in interface QueryDefinition
Parameters:
b - - boolean value
Returns:
the corresponding Expression literal

literal

public Expression literal(Calendar c)
Description copied from interface: QueryDefinition
Create an Expression corresponding to a Calendar value.

Specified by:
literal in interface QueryDefinition
Parameters:
c - - Calendar value
Returns:
the corresponding Expression literal

literal

public Expression literal(Date d)
Description copied from interface: QueryDefinition
Create an Expression corresponding to a Date value.

Specified by:
literal in interface QueryDefinition
Parameters:
d - - Date value
Returns:
the corresponding Expression literal

literal

public Expression literal(char c)
Description copied from interface: QueryDefinition
Create an Expression corresponding to a character value.

Specified by:
literal in interface QueryDefinition
Returns:
the corresponding Expression literal

literal

public Expression literal(Class cls)
Description copied from interface: QueryDefinition
Create an Expression corresponding to an entity class.

Specified by:
literal in interface QueryDefinition
Parameters:
cls - - entity class
Returns:
the corresponding Expression literal

literal

public Expression literal(Enum<?> e)
Description copied from interface: QueryDefinition
Create an Expression corresponding to an enum.

Specified by:
literal in interface QueryDefinition
Parameters:
e - - enum
Returns:
the corresponding Expression literal

newInstance

public SelectItem newInstance(Class cls,
                              SelectItem... args)
Description copied from interface: QueryDefinition
Specify that a constructor for the given class is to be applied to the corresponding query results after the query is executed. The class must have a constructor that accepts the Java argument types corresponding to the given select items.

Specified by:
newInstance in interface QueryDefinition
Parameters:
cls - - a class with the correponding constructor
args - - select items that correspond to result types that are valid as arguments to the constructor

nullLiteral

public Expression nullLiteral()
Description copied from interface: QueryDefinition
Create an Expression corresponding to a null value.

Specified by:
nullLiteral in interface QueryDefinition
Returns:
the corresponding Expression literal

nullif

public Expression nullif(Expression exp1,
                         Expression exp2)
Description copied from interface: QueryDefinition
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.

Specified by:
nullif in interface QueryDefinition
Returns:
Expression corresponding to the given nullif expression

nullif

public Expression nullif(Number arg1,
                         Number arg2)
Description copied from interface: QueryDefinition
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.

Specified by:
nullif in interface QueryDefinition
Returns:
Expression corresponding to the given nullif expression

nullif

public Expression nullif(String arg1,
                         String arg2)
Description copied from interface: QueryDefinition
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.

Specified by:
nullif in interface QueryDefinition
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.
Returns:
Expression corresponding to the given nullif expression

nullif

public Expression nullif(Date arg1,
                         Date arg2)
Description copied from interface: QueryDefinition
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.

Specified by:
nullif in interface QueryDefinition
Returns:
Expression corresponding to the given nullif expression

nullif

public Expression nullif(Calendar arg1,
                         Calendar arg2)
Description copied from interface: QueryDefinition
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.

Specified by:
nullif in interface QueryDefinition
Returns:
Expression corresponding to the given nullif expression

nullif

public Expression nullif(Class arg1,
                         Class arg2)
Description copied from interface: QueryDefinition
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.

Specified by:
nullif in interface QueryDefinition
Returns:
Expression corresponding to the given nullif expression

nullif

public Expression nullif(Enum<?> arg1,
                         Enum<?> arg2)
Description copied from interface: QueryDefinition
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.

Specified by:
nullif in interface QueryDefinition
Returns:
Expression corresponding to the given nullif expression

orderBy

public QueryDefinition orderBy(OrderByItem... orderByItems)
Description copied from interface: QueryDefinition
Specify the items of the select list that are used in ordering the query results. Replaces the previous order-by list, if any.

Specified by:
orderBy in interface QueryDefinition
Parameters:
orderByItems - - one or more OrderByItem instances
Returns:
the modified QueryDefinition instance

orderBy

public QueryDefinition orderBy(List<OrderByItem> orderByItemList)
Description copied from interface: QueryDefinition
Specify the items of the select list that are used in ordering the query results. Replaces the previous order-by list, if any.

Specified by:
orderBy in interface QueryDefinition
Parameters:
orderByItemList - - a list containing one or more OrderByItem instances
Returns:
the modified QueryDefinition instance

param

public Expression param(String name)
Description copied from interface: QueryDefinition
Specify use of a parameter of the given name.

Specified by:
param in interface QueryDefinition
Returns:
an Expression corresponding to a named parameter

predicate

public Predicate predicate(boolean b)
Description copied from interface: QueryDefinition
Create a predicate value from the given boolean.

Specified by:
predicate in interface QueryDefinition
Parameters:
b - boolean value
Returns:
a true or false predicate

select

public QueryDefinition select(SelectItem... selectItems)
Description copied from interface: QueryDefinition
Specify the objects / values to be returned. Replaces the previous select list, if any. If no select items are specified and there is only one query root, the root entity is assumed to be the result.

Specified by:
select in interface QueryDefinition
Parameters:
selectItems - - one or more SelectItem instances
Returns:
the modified query definition instance

select

public QueryDefinition select(List<SelectItem> selectItemList)
Description copied from interface: QueryDefinition
Specify the objects / values to be returned. Replaces the previous select list, if any. If no select items are specified and there is only one query root, the root entity is assumed to be the result.

Specified by:
select in interface QueryDefinition
Parameters:
selectItemList - - a list containing one or more SelectItem instances
Returns:
the modified query definition instance

selectDistinct

public QueryDefinition selectDistinct(SelectItem... selectItems)
Description copied from interface: QueryDefinition
Specify the objects / values to be returned. Duplicate results will be eliminated. Replaces the previous select list, if any. If no select items are specified and there is only one query root, the root entity is assumed to be the result.

Specified by:
selectDistinct in interface QueryDefinition
Parameters:
selectItems - - one or more SelectItem instances
Returns:
the modified query definition instance

selectDistinct

public QueryDefinition selectDistinct(List<SelectItem> selectItemList)
Description copied from interface: QueryDefinition
Specify the objects / values to be returned. Duplicate results will be eliminated. Replaces the previous select list, if any. If no select items are specified, and there is only one query root, the root entity is assumed to be the result. is assumed to be the result.

Specified by:
selectDistinct in interface QueryDefinition
Parameters:
selectItemList - - a list containing one or more SelectItem instances
Returns:
the modified query definition instance

simpleCase

public CaseExpression simpleCase(Expression caseOperand)
Description copied from interface: QueryDefinition
Create a simple case expression with the given case operand. A simple case expression is of the form:

simpleCase(case-operand) .when(scalar-expression).then(scalar-expression) .when(scalar-expression).then(scalar-expression) ... .elseCase(scalar-expression)

Specified by:
simpleCase in interface QueryDefinition
Parameters:
caseOperand - - expression used for testing against the when scalar expressions
Returns:
case expression with the given case operand

simpleCase

public CaseExpression simpleCase(Number caseOperand)
Description copied from interface: QueryDefinition
Create a simple case expression with the given case operand. A simple case expression is of the form:

simpleCase(case-operand) .when(scalar-expression).then(scalar-expression) .when(scalar-expression).then(scalar-expression) ... .elseCase(scalar-expression)

Specified by:
simpleCase in interface QueryDefinition
Parameters:
caseOperand - - numeric value used for testing against the when scalar expressions
Returns:
case expression with the given case operand

simpleCase

public CaseExpression simpleCase(String caseOperand)
Description copied from interface: QueryDefinition
Create a simple case expression with the given case operand. A simple case expression is of the form:

simpleCase(case-operand) .when(scalar-expression).then(scalar-expression) .when(scalar-expression).then(scalar-expression) ... .elseCase(scalar-expression)

Specified by:
simpleCase in interface QueryDefinition
Parameters:
caseOperand - - value used for testing against the when scalar expressions
Returns:
case expression with the given case operand

simpleCase

public CaseExpression simpleCase(Date caseOperand)
Description copied from interface: QueryDefinition
Create a simple case expression with the given case operand. A simple case expression is of the form:

simpleCase(case-operand) .when(scalar-expression).then(scalar-expression) .when(scalar-expression).then(scalar-expression) ... .elseCase(scalar-expression)

Specified by:
simpleCase in interface QueryDefinition
Parameters:
caseOperand - - value used for testing against the when scalar expressions
Returns:
case expression with the given case operand

simpleCase

public CaseExpression simpleCase(Calendar caseOperand)
Description copied from interface: QueryDefinition
Create a simple case expression with the given case operand. A simple case expression is of the form:

simpleCase(case-operand) .when(scalar-expression).then(scalar-expression) .when(scalar-expression).then(scalar-expression) ... .elseCase(scalar-expression)

Specified by:
simpleCase in interface QueryDefinition
Parameters:
caseOperand - - value used for testing against the when scalar expressions
Returns:
case expression with the given case operand

simpleCase

public CaseExpression simpleCase(Class caseOperand)
Description copied from interface: QueryDefinition
Create a simple case expression with the given case operand. A simple case expression is of the form:

simpleCase(case-operand) .when(scalar-expression).then(scalar-expression) .when(scalar-expression).then(scalar-expression) ... .elseCase(scalar-expression)

Specified by:
simpleCase in interface QueryDefinition
Parameters:
caseOperand - - value used for testing against the when scalar expressions
Returns:
case expression with the given case operand

simpleCase

public CaseExpression simpleCase(Enum<?> caseOperand)
Description copied from interface: QueryDefinition
Create a simple case expression with the given case operand. A simple case expression is of the form:

simpleCase(case-operand) .when(scalar-expression).then(scalar-expression) .when(scalar-expression).then(scalar-expression) ... .elseCase(scalar-expression)

Specified by:
simpleCase in interface QueryDefinition
Parameters:
caseOperand - - value used for testing against the when scalar expressions
Returns:
case expression with the given case operand

where

public QueryDefinition where(Predicate predicate)
Description copied from interface: QueryDefinition
Modifies the query definition to restrict the result of the query according to the specified predicate. Replaces the previously added restriction(s), if any.

Specified by:
where in interface QueryDefinition
Parameters:
predicate - - a simple or compound conditional predicate
Returns:
the modified QueryDefinition instance


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.