Class AbstractDomainObject
- java.lang.Object
-
- org.apache.openjpa.persistence.query.AbstractDomainObject
-
- All Implemented Interfaces:
Serializable,DomainObject,Expression,OrderByItem,PathExpression,PredicateOperand,QueryDefinition,SelectItem,Subquery,Visitable
- Direct Known Subclasses:
FetchPath,JoinPath,OperatorPath,RootPath
public abstract class AbstractDomainObject extends Object 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 Modifier and Type Field Description protected PathOperator_operatorprotected QueryDefinitionImpl_ownerprotected org.apache.openjpa.persistence.query.AbstractPath_parentprotected Object_part2static StringCLOSE_BRACEstatic StringCOMMAstatic StringEMPTYstatic StringOPEN_BRACEstatic StringSPACE
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDomainObject(QueryDefinitionImpl owner, org.apache.openjpa.persistence.query.AbstractPath parent, PathOperator op, Object part2)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expressionabs()Absolute value.DomainObjectaddRoot(Class cls)Adding a root adds a root domain to the owning query.DomainObjectaddSubqueryRoot(PathExpression path)Adding a query root adds a subquery to the owning query.Subqueryall()Derives this path as ALL(subquery) to its owning query.Subqueryany()Adds this path as ANY(subquery) to its owning query.OrderByItemasc()Return an OrderByItem referencing the SelectItem and specifying ascending ordering.StringasExpression(org.apache.openjpa.persistence.query.AliasContext ctx)Get a JPQL fragment as used in WHERE clause.StringasJoinable(org.apache.openjpa.persistence.query.AliasContext ctx)Gets the string representation in FROM clause.StringasProjection(org.apache.openjpa.persistence.query.AliasContext ctx)Gets the string representation in SELECT projection.Aggregateavg()Specify that the avg operation is to be applied.Predicatebetween(Number arg1, Number arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(Number arg1, PredicateOperand arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(String arg1, String arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(String arg1, PredicateOperand arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(Calendar arg1, Calendar arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(Calendar arg1, PredicateOperand arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(Date arg1, Date arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(Date arg1, PredicateOperand arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(PredicateOperand arg1, Number arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(PredicateOperand arg1, String arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(PredicateOperand arg1, Calendar arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(PredicateOperand arg1, Date arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Predicatebetween(PredicateOperand arg1, PredicateOperand arg2)Create a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.Expressioncoalesce(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.Expressioncoalesce(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.Expressioncoalesce(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.Expressioncoalesce(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.Expressionconcat(String... str)Concatenate a string with other string(s).Expressionconcat(Expression... exprs)Concatenate a string with other string(s).Aggregatecount()Specify that the count operation is to be applied.ExpressioncurrentDate()Create an Expression corresponding to the current date on the database server at the time of query execution.ExpressioncurrentTime()Create an Expression corresponding to the current time on the database server at the time of query execution.ExpressioncurrentTimestamp()Create an Expression corresponding to the current timestamp on the database server at the time of query execution.OrderByItemdesc()Return an OrderByItem referencing the SelectItem and specifying descending ordering.ExpressiondividedBy(Number num)Division.ExpressiondividedBy(Expression expr)Division.SelectItementry()Derives by ENTRY() operation on this path.Predicateequal(boolean arg)Create a predicate for testing equality with the specified argument.Predicateequal(Class cls)Create a predicate for testing equality with the specified argument.Predicateequal(Enum<?> e)Create a predicate for testing equality with the specified argument.Predicateequal(Number arg)Create a predicate for testing equality with the specified argument.Predicateequal(String arg)Create a predicate for testing equality with the specified argument.Predicateequal(Calendar arg)Create a predicate for testing equality with the specified argument.Predicateequal(Date arg)Create a predicate for testing equality with the specified argument.Predicateequal(PredicateOperand arg)Create a predicate for testing equality with the specified argument.Predicateexists()Adds this path as EXISTS(subquery) to its owning query.CaseExpressiongeneralCase()Create an empty general case expression.PathExpressionget(String attr)Derives a path from this path by navigating through the given field.StringgetAliasHint(org.apache.openjpa.persistence.query.AliasContext ctx)Gets the hint to be used while creating alias.ObjectgetLastSegment()Gets the last segment of this path.PathOperatorgetOperator()Gets operator that derived this receiver from its parent.org.apache.openjpa.persistence.query.AbstractPathgetParent()Gets the parent from which this receiver has been derived.PredicategreaterEqual(Number arg)Create a predicate for testing whether the PredicateOperand is greater than or equal to the argument.PredicategreaterEqual(String arg)Create a predicate for testing whether the PredicateOperand is greater than or equal to the argument.PredicategreaterEqual(Calendar arg)Create a predicate for testing whether the PredicateOperand is greater than or equal to the argument.PredicategreaterEqual(Date arg)Create a predicate for testing whether the PredicateOperand is greater than or equal to the argument.PredicategreaterEqual(PredicateOperand arg)Create a predicate for testing whether the PredicateOperand is greater than or equal to the argument.PredicategreaterThan(Number arg)Create a predicate for testing whether the PredicateOperand is greater than the argument.PredicategreaterThan(String arg)Create a predicate for testing whether the PredicateOperand is greater than the argument.PredicategreaterThan(Calendar arg)Create a predicate for testing whether the PredicateOperand is greater than the argument.PredicategreaterThan(Date arg)Create a predicate for testing whether the PredicateOperand is greater than the argument.PredicategreaterThan(PredicateOperand arg)Create a predicate for testing whether the PredicateOperand is greater than the argument.QueryDefinitiongroupBy(List<PathExpression> pathExprList)Specify the items that are used to form groups over the query results.QueryDefinitiongroupBy(PathExpression... pathExprs)Specify the items that are used to form groups over the query results.QueryDefinitionhaving(Predicate predicate)Specify the restrictions over the groups of a query.Predicatein(Class... classes)Create a predicate for testing whether the expression value is a member of the argument list.Predicatein(Enum<?>... enums)Create a predicate for testing whether the expression value is a member of the argument list.Predicatein(Number... nums)Create a predicate for testing whether the expression value is a member of the argument list.Predicatein(String... strings)Create a predicate for testing whether the expression value is a member of the argument list.Predicatein(Expression... params)Create a predicate for testing whether the expression value is a member of the argument list.Predicatein(Subquery subquery)Create a predicate for testing whether the expression value is a member of a subquery result.Expressionindex()Derives by INDEX() operation on this path.PredicateisEmpty()Add a restriction that the path expression must correspond to an association or element collection that is empty (has no elements).PredicateisNull()Create a predicate for testing whether the value of the expression is null.DomainObjectjoin(String attr)Derives a path from this path by joining the given field.FetchJoinObjectjoinFetch(String attr)Derives a path from this path by fetch joining the given field.PathExpressionkey()Derives by KEY() operation on this path.DomainObjectleftJoin(String attr)Derives a path from this path by outer joining the given field.FetchJoinObjectleftJoinFetch(String attr)Derives a path from this path by fetch joining the given field.Expressionlength()String length This method must be invoked on an expression corresponding to a string.PredicatelessEqual(Number arg)Create a predicate for testing whether the PredicateOperand is less than or equal to the argument.PredicatelessEqual(String arg)Create a predicate for testing whether the PredicateOperand is less than or equal to the argument.PredicatelessEqual(Calendar arg)Create a predicate for testing whether the PredicateOperand is less than or equal to the argument.PredicatelessEqual(Date arg)Create a predicate for testing whether the PredicateOperand is less than or equal to the argument.PredicatelessEqual(PredicateOperand arg)Create a predicate for testing whether the PredicateOperand is less than or equal to the argument.PredicatelessThan(Number arg)Create a predicate for testing whether the PredicateOperand is less than the argument.PredicatelessThan(String arg)Create a predicate for testing whether the PredicateOperand is less than the argument.PredicatelessThan(Calendar arg)Create a predicate for testing whether the PredicateOperand is less than the argument.PredicatelessThan(Date arg)Create a predicate for testing whether the PredicateOperand is less than the argument.PredicatelessThan(PredicateOperand arg)Create a predicate for testing whether the PredicateOperand is less than the argument.Predicatelike(String pattern)Create a predicate for testing whether the PredicateOperand satisfies the given pattern.Predicatelike(String pattern, char escChar)Create a predicate for testing whether the PredicateOperand satisfies the given pattern.Predicatelike(String pattern, PredicateOperand escapeChar)Create a predicate for testing whether the PredicateOperand satisfies the given pattern.Predicatelike(PredicateOperand pattern)Create a predicate for testing whether the PredicateOperand satisfies the given pattern.Predicatelike(PredicateOperand pattern, char escapeChar)Create a predicate for testing whether the PredicateOperand satisfies the given pattern.Predicatelike(PredicateOperand pattern, PredicateOperand escChar)Create a predicate for testing whether the PredicateOperand satisfies the given pattern.Expressionliteral(boolean b)Create an Expression corresponding to a boolean value.Expressionliteral(char c)Create an Expression corresponding to a character value.Expressionliteral(Class cls)Create an Expression corresponding to an entity class.Expressionliteral(Enum<?> e)Create an Expression corresponding to an enum.Expressionliteral(Number n)Create an Expression corresponding to a numeric value.Expressionliteral(String s)Create an Expression corresponding to a String value.Expressionliteral(Calendar c)Create an Expression corresponding to a Calendar value.Expressionliteral(Date d)Create an Expression corresponding to a Date value.Expressionlocate(String str)Locate a string contained within the string corresponding to the expression on which the method was invoked.Expressionlocate(String str, int position)Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position.Expressionlocate(String str, Expression position)Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position.Expressionlocate(Expression expr)Locate a string contained within the string corresponding to the expression on which the method was invoked.Expressionlocate(Expression str, int position)Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position.Expressionlocate(Expression str, Expression position)Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position.Expressionlower()Convert string to lowercase.Aggregatemax()Specify that the max operation is to be applied.Predicatemember(PathExpression arg)Create a predicate for testing whether the expression is a member of the association or element collection denoted by the path expression.Aggregatemin()Specify that the min operation is to be applied.Expressionminus()Unary minus.Expressionminus(Number num)Subtraction.Expressionminus(Expression expr)Subtraction.Expressionmod(int num)Modulo operation.Expressionmod(Expression expr)Modulo operation.SelectItemnewInstance(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.PredicatenotEqual(boolean arg)Create a predicate for testing inequality with the specified argument.PredicatenotEqual(Class cls)Create a predicate for testing inequality with the specified argument.PredicatenotEqual(Enum<?> e)Create a predicate for testing inequality with the specified argument.PredicatenotEqual(Number arg)Create a predicate for testing inequality with the specified argument.PredicatenotEqual(String arg)Create a predicate for testing inequality with the specified argument.PredicatenotEqual(Calendar arg)Create a predicate for testing inequality with the specified argument.PredicatenotEqual(Date arg)Create a predicate for testing inequality with the specified argument.PredicatenotEqual(PredicateOperand arg)Create a predicate for testing inequality with the specified argument.Expressionnullif(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.Expressionnullif(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.Expressionnullif(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.Expressionnullif(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.Expressionnullif(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.Expressionnullif(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.Expressionnullif(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.ExpressionnullLiteral()Create an Expression corresponding to a null value.QueryDefinitionorderBy(List<OrderByItem> orderByItemList)Specify the items of the select list that are used in ordering the query results.QueryDefinitionorderBy(OrderByItem... orderByItems)Specify the items of the select list that are used in ordering the query results.Expressionparam(String name)Specify use of a parameter of the given name.Expressionplus(Number num)Addition.Expressionplus(Expression expr)Addition.Predicatepredicate(boolean b)Create a predicate value from the given boolean.QueryDefinitionselect(List<SelectItem> selectItemList)Specify the objects / values to be returned.QueryDefinitionselect(SelectItem... selectItems)Specify the objects / values to be returned.QueryDefinitionselectDistinct(List<SelectItem> selectItemList)Specify the objects / values to be returned.QueryDefinitionselectDistinct(SelectItem... selectItems)Specify the objects / values to be returned.CaseExpressionsimpleCase(Class caseOperand)Create a simple case expression with the given case operand.CaseExpressionsimpleCase(Enum<?> caseOperand)Create a simple case expression with the given case operand.CaseExpressionsimpleCase(Number caseOperand)Create a simple case expression with the given case operand.CaseExpressionsimpleCase(String caseOperand)Create a simple case expression with the given case operand.CaseExpressionsimpleCase(Calendar caseOperand)Create a simple case expression with the given case operand.CaseExpressionsimpleCase(Date caseOperand)Create a simple case expression with the given case operand.CaseExpressionsimpleCase(Expression caseOperand)Create a simple case expression with the given case operand.Expressionsize()Return an expression that corresponds to the number of elements association or element collection corresponding to the path expression.Subquerysome()Adds this path as SOME(subquery) to its owning query.Expressionsqrt()Square root.Expressionsubstring(int start)Extract a substring starting at specified position through to the end of the string.Expressionsubstring(int start, int len)Extract a substring.Expressionsubstring(int start, Expression len)Extract a substring.Expressionsubstring(Expression start)Extract a substring starting at specified position through to the end of the string.Expressionsubstring(Expression start, int len)Extract a substring.Expressionsubstring(Expression start, Expression len)Extract a substring.Aggregatesum()Specify that the sum operation is to be applied.Expressiontimes(Number num)Multiplication.Expressiontimes(Expression expr)Multiplication.Expressiontrim()Trim leading and trailing blanks.Expressiontrim(char c)Trim leading and trailing occurrences of character from the string.Expressiontrim(char c, TrimSpec spec)Trim occurrences of the character from leading or trailing (or both) positions of the string, as specified by trim spec.Expressiontrim(Expression expr)Trim leading and trailing occurrences of character specified by the expression argument from the string.Expressiontrim(Expression expr, TrimSpec spec)Trim occurrences of the character specified by the expression argument from leading or trailing (or both) positions of the string, as specified by trim spec.Expressiontrim(TrimSpec spec)Trim leading, trailing blanks (or both) as specified by trim spec.Expressiontype()Return an expression that corresponds to the type of the entity.Expressionupper()Convert string to uppercase.PathExpressionvalue()Derives a path by VALUE() operation on this path.QueryDefinitionwhere(Predicate predicate)Modifies the query definition to restrict the result of the query according to the specified predicate.-
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.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.PathExpression
avg, count, isEmpty, max, min, size, sum, type
-
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.SelectItem
asc, desc
-
Methods inherited from interface org.apache.openjpa.persistence.query.Visitable
asExpression, asJoinable, asProjection
-
-
-
-
Field Detail
-
_parent
protected final org.apache.openjpa.persistence.query.AbstractPath _parent
-
_part2
protected final Object _part2
-
_operator
protected final PathOperator _operator
-
_owner
protected final QueryDefinitionImpl _owner
-
SPACE
public static final String SPACE
- See Also:
- Constant Field Values
-
OPEN_BRACE
public static final String OPEN_BRACE
- See Also:
- Constant Field Values
-
CLOSE_BRACE
public static final String CLOSE_BRACE
- See Also:
- Constant Field Values
-
COMMA
public static final String COMMA
- See Also:
- Constant Field Values
-
EMPTY
public static final String EMPTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractDomainObject
protected AbstractDomainObject(QueryDefinitionImpl owner, org.apache.openjpa.persistence.query.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:
addRootin interfaceQueryDefinition- 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:
addSubqueryRootin interfaceQueryDefinition- 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:
getin interfacePathExpression- 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:
joinin interfaceDomainObject- 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:
leftJoinin interfaceDomainObject- 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:
joinFetchin interfaceDomainObject- 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:
leftJoinFetchin interfaceDomainObject- 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:
keyin interfaceDomainObject- Returns:
- PathExpression corresponding to the map key
-
entry
public SelectItem entry()
Derives by ENTRY() operation on this path.- Specified by:
entryin interfaceDomainObject- Returns:
- SelectItem corresponding to the map entry
-
index
public Expression index()
Derives by INDEX() operation on this path.- Specified by:
indexin interfaceDomainObject- Returns:
- Expression denoting the index
-
value
public PathExpression value()
Derives a path by VALUE() operation on this path.- Specified by:
valuein interfaceDomainObject- Returns:
- PathExpression corresponding to the map value
-
all
public Subquery all()
Derives this path as ALL(subquery) to its owning query.- Specified by:
allin interfaceQueryDefinition- Returns:
- the resulting Subquery
-
any
public Subquery any()
Adds this path as ANY(subquery) to its owning query.- Specified by:
anyin interfaceQueryDefinition- Returns:
- the resulting Subquery
-
some
public Subquery some()
Adds this path as SOME(subquery) to its owning query.- Specified by:
somein interfaceQueryDefinition- Returns:
- the resulting Subquery
-
exists
public Predicate exists()
Adds this path as EXISTS(subquery) to its owning query.- Specified by:
existsin interfaceQueryDefinition- Returns:
- the resulting predicate
-
coalesce
public Expression coalesce(Expression... exp)
Description copied from interface:QueryDefinitioncoalesce 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:
coalescein interfaceQueryDefinition- 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:QueryDefinitioncoalesce 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:
coalescein interfaceQueryDefinition- 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:QueryDefinitioncoalesce 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:
coalescein interfaceQueryDefinition- 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:QueryDefinitioncoalesce 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:
coalescein interfaceQueryDefinition- 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:QueryDefinitionCreate an Expression corresponding to the current date on the database server at the time of query execution.- Specified by:
currentDatein interfaceQueryDefinition- Returns:
- the corresponding Expression
-
currentTime
public Expression currentTime()
Description copied from interface:QueryDefinitionCreate an Expression corresponding to the current time on the database server at the time of query execution.- Specified by:
currentTimein interfaceQueryDefinition- Returns:
- the corresponding Expression
-
currentTimestamp
public Expression currentTimestamp()
Description copied from interface:QueryDefinitionCreate an Expression corresponding to the current timestamp on the database server at the time of query execution.- Specified by:
currentTimestampin interfaceQueryDefinition- Returns:
- the corresponding Expression
-
generalCase
public CaseExpression generalCase()
Description copied from interface:QueryDefinitionCreate 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:
generalCasein interfaceQueryDefinition- Returns:
- empty general case expression
-
groupBy
public QueryDefinition groupBy(PathExpression... pathExprs)
Description copied from interface:QueryDefinitionSpecify the items that are used to form groups over the query results. Replaces the previous group-by list, if any.- Specified by:
groupByin interfaceQueryDefinition- Returns:
- the modified QueryDefinition instance
-
groupBy
public QueryDefinition groupBy(List<PathExpression> pathExprList)
Description copied from interface:QueryDefinitionSpecify the items that are used to form groups over the query results. Replaces the previous group-by list, if any.- Specified by:
groupByin interfaceQueryDefinition- Returns:
- the modified QueryDefinition instance
-
having
public QueryDefinition having(Predicate predicate)
Description copied from interface:QueryDefinitionSpecify the restrictions over the groups of a query. Replaces the previous having restriction(s), if any.- Specified by:
havingin interfaceQueryDefinition- Returns:
- the modified QueryDefinition Instance
-
literal
public Expression literal(String s)
Description copied from interface:QueryDefinitionCreate an Expression corresponding to a String value.- Specified by:
literalin interfaceQueryDefinition- Parameters:
s- - string value- Returns:
- the corresponding Expression literal
-
literal
public Expression literal(Number n)
Description copied from interface:QueryDefinitionCreate an Expression corresponding to a numeric value.- Specified by:
literalin interfaceQueryDefinition- Parameters:
n- - numeric value- Returns:
- the corresponding Expression literal
-
literal
public Expression literal(boolean b)
Description copied from interface:QueryDefinitionCreate an Expression corresponding to a boolean value.- Specified by:
literalin interfaceQueryDefinition- Parameters:
b- - boolean value- Returns:
- the corresponding Expression literal
-
literal
public Expression literal(Calendar c)
Description copied from interface:QueryDefinitionCreate an Expression corresponding to a Calendar value.- Specified by:
literalin interfaceQueryDefinition- Parameters:
c- - Calendar value- Returns:
- the corresponding Expression literal
-
literal
public Expression literal(Date d)
Description copied from interface:QueryDefinitionCreate an Expression corresponding to a Date value.- Specified by:
literalin interfaceQueryDefinition- Parameters:
d- - Date value- Returns:
- the corresponding Expression literal
-
literal
public Expression literal(char c)
Description copied from interface:QueryDefinitionCreate an Expression corresponding to a character value.- Specified by:
literalin interfaceQueryDefinition- Returns:
- the corresponding Expression literal
-
literal
public Expression literal(Class cls)
Description copied from interface:QueryDefinitionCreate an Expression corresponding to an entity class.- Specified by:
literalin interfaceQueryDefinition- Parameters:
cls- - entity class- Returns:
- the corresponding Expression literal
-
literal
public Expression literal(Enum<?> e)
Description copied from interface:QueryDefinitionCreate an Expression corresponding to an enum.- Specified by:
literalin interfaceQueryDefinition- Parameters:
e- - enum- Returns:
- the corresponding Expression literal
-
newInstance
public SelectItem newInstance(Class cls, SelectItem... args)
Description copied from interface:QueryDefinitionSpecify 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:
newInstancein interfaceQueryDefinition- Parameters:
cls- - a class with the correponding constructorargs- - select items that correspond to result types that are valid as arguments to the constructor
-
nullLiteral
public Expression nullLiteral()
Description copied from interface:QueryDefinitionCreate an Expression corresponding to a null value.- Specified by:
nullLiteralin interfaceQueryDefinition- Returns:
- the corresponding Expression literal
-
nullif
public Expression nullif(Expression exp1, Expression exp2)
Description copied from interface:QueryDefinitionnullif 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:
nullifin interfaceQueryDefinition- Returns:
- Expression corresponding to the given nullif expression
-
nullif
public Expression nullif(Number arg1, Number arg2)
Description copied from interface:QueryDefinitionnullif 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:
nullifin interfaceQueryDefinition- Returns:
- Expression corresponding to the given nullif expression
-
nullif
public Expression nullif(String arg1, String arg2)
Description copied from interface:QueryDefinitionnullif 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:
nullifin interfaceQueryDefinitionarg2- 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:QueryDefinitionnullif 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:
nullifin interfaceQueryDefinition- Returns:
- Expression corresponding to the given nullif expression
-
nullif
public Expression nullif(Calendar arg1, Calendar arg2)
Description copied from interface:QueryDefinitionnullif 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:
nullifin interfaceQueryDefinition- Returns:
- Expression corresponding to the given nullif expression
-
nullif
public Expression nullif(Class arg1, Class arg2)
Description copied from interface:QueryDefinitionnullif 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:
nullifin interfaceQueryDefinition- Returns:
- Expression corresponding to the given nullif expression
-
nullif
public Expression nullif(Enum<?> arg1, Enum<?> arg2)
Description copied from interface:QueryDefinitionnullif 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:
nullifin interfaceQueryDefinition- Returns:
- Expression corresponding to the given nullif expression
-
orderBy
public QueryDefinition orderBy(OrderByItem... orderByItems)
Description copied from interface:QueryDefinitionSpecify the items of the select list that are used in ordering the query results. Replaces the previous order-by list, if any.- Specified by:
orderByin interfaceQueryDefinition- Parameters:
orderByItems- - one or more OrderByItem instances- Returns:
- the modified QueryDefinition instance
-
orderBy
public QueryDefinition orderBy(List<OrderByItem> orderByItemList)
Description copied from interface:QueryDefinitionSpecify the items of the select list that are used in ordering the query results. Replaces the previous order-by list, if any.- Specified by:
orderByin interfaceQueryDefinition- 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:QueryDefinitionSpecify use of a parameter of the given name.- Specified by:
paramin interfaceQueryDefinition- Returns:
- an Expression corresponding to a named parameter
-
predicate
public Predicate predicate(boolean b)
Description copied from interface:QueryDefinitionCreate a predicate value from the given boolean.- Specified by:
predicatein interfaceQueryDefinition- Parameters:
b- boolean value- Returns:
- a true or false predicate
-
select
public QueryDefinition select(SelectItem... selectItems)
Description copied from interface:QueryDefinitionSpecify 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:
selectin interfaceQueryDefinition- Parameters:
selectItems- - one or more SelectItem instances- Returns:
- the modified query definition instance
-
select
public QueryDefinition select(List<SelectItem> selectItemList)
Description copied from interface:QueryDefinitionSpecify 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:
selectin interfaceQueryDefinition- 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:QueryDefinitionSpecify 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:
selectDistinctin interfaceQueryDefinition- Parameters:
selectItems- - one or more SelectItem instances- Returns:
- the modified query definition instance
-
selectDistinct
public QueryDefinition selectDistinct(List<SelectItem> selectItemList)
Description copied from interface:QueryDefinitionSpecify 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:
selectDistinctin interfaceQueryDefinition- 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:QueryDefinitionCreate 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:
simpleCasein interfaceQueryDefinition- 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:QueryDefinitionCreate 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:
simpleCasein interfaceQueryDefinition- 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:QueryDefinitionCreate 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:
simpleCasein interfaceQueryDefinition- 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:QueryDefinitionCreate 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:
simpleCasein interfaceQueryDefinition- 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:QueryDefinitionCreate 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:
simpleCasein interfaceQueryDefinition- 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:QueryDefinitionCreate 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:
simpleCasein interfaceQueryDefinition- 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:QueryDefinitionCreate 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:
simpleCasein interfaceQueryDefinition- 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:QueryDefinitionModifies 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:
wherein interfaceQueryDefinition- Parameters:
predicate- - a simple or compound conditional predicate- Returns:
- the modified QueryDefinition instance
-
getParent
public org.apache.openjpa.persistence.query.AbstractPath getParent()
Gets the parent from which this receiver has been derived. Can be null for a root path.
-
getOperator
public PathOperator getOperator()
Gets operator that derived this receiver from its parent.
-
getLastSegment
public Object getLastSegment()
Gets the last segment of this path. Concrete implementation should return a covariant type.
-
avg
public Aggregate avg()
Description copied from interface:PathExpressionSpecify that the avg operation is to be applied. The path expression must correspond to an attribute of a numeric type. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.- Specified by:
avgin interfacePathExpression- Returns:
- the resulting aggregate
-
count
public Aggregate count()
Description copied from interface:PathExpressionSpecify that the count operation is to be applied. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.- Specified by:
countin interfacePathExpression- Returns:
- the resulting aggregate
-
isEmpty
public Predicate isEmpty()
Description copied from interface:PathExpressionAdd a restriction that the path expression must correspond to an association or element collection that is empty (has no elements). This method can only be invoked on a path expression that corresponds to a multi-valued association or to an element collection.- Specified by:
isEmptyin interfacePathExpression- Returns:
- predicate corresponding to the restriction
-
max
public Aggregate max()
Description copied from interface:PathExpressionSpecify that the max operation is to be applied. The path expression must correspond to an attribute of an orderable type. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.- Specified by:
maxin interfacePathExpression- Returns:
- the resulting aggregate
-
min
public Aggregate min()
Description copied from interface:PathExpressionSpecify that the min operation is to be applied. The path expression must correspond to an attribute of an orderable type. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.- Specified by:
minin interfacePathExpression- Returns:
- the resulting aggregate
-
size
public Expression size()
Description copied from interface:PathExpressionReturn an expression that corresponds to the number of elements association or element collection corresponding to the path expression. This method can only be invoked on a path expression that corresponds to a multi-valued association or to an element collection.- Specified by:
sizein interfacePathExpression- Returns:
- expression denoting the size
-
sum
public Aggregate sum()
Description copied from interface:PathExpressionSpecify that the sum operation is to be applied. The path expression must correspond to an attribute of a numeric type. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.- Specified by:
sumin interfacePathExpression- Returns:
- the resulting aggregate
-
type
public Expression type()
Description copied from interface:PathExpressionReturn an expression that corresponds to the type of the entity. This method can only be invoked on a path expression corresponding to an entity. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association.- Specified by:
typein interfacePathExpression- Returns:
- expression denoting the entity's type
-
abs
public Expression abs()
Description copied from interface:ExpressionAbsolute value. This method must be invoked on an expression corresponding to a number.- Specified by:
absin interfaceExpression- Returns:
- expression corresponding to the absolute value
-
concat
public Expression concat(String... str)
Description copied from interface:ExpressionConcatenate a string with other string(s). This method must be invoked on an expression corresponding to a string.- Specified by:
concatin interfaceExpression- Parameters:
str- - string(s)- Returns:
- expression denoting the concatenation of the strings, starting with the string corresponding to the expression on which the method was invoked.
-
concat
public Expression concat(Expression... exprs)
Description copied from interface:ExpressionConcatenate a string with other string(s). This method must be invoked on an expression corresponding to a string.- Specified by:
concatin interfaceExpression- Parameters:
exprs- - expression(s) corresponding to string(s)- Returns:
- expression denoting the concatenation of the strings, starting with the string corresponding to the expression on which the method was invoked.
-
dividedBy
public Expression dividedBy(Number num)
Description copied from interface:ExpressionDivision. This method must be invoked on an expression corresponding to a number.- Specified by:
dividedByin interfaceExpression- Parameters:
num- - divisor- Returns:
- expression denoting the result of dividing the number corresponding to the expression on which the method was invoked by the argument
-
dividedBy
public Expression dividedBy(Expression expr)
Description copied from interface:ExpressionDivision. This method must be invoked on an expression corresponding to a number.- Specified by:
dividedByin interfaceExpression- Parameters:
expr- - expression corresponding to the divisor- Returns:
- expression denoting the result of dividing the number corresponding to the expression on which the method was invoked by the number denoted by the argument
-
in
public Predicate in(String... strings)
Description copied from interface:ExpressionCreate a predicate for testing whether the expression value is a member of the argument list.- Specified by:
inin interfaceExpression- Returns:
- conditional predicate
-
in
public Predicate in(Number... nums)
Description copied from interface:ExpressionCreate a predicate for testing whether the expression value is a member of the argument list.- Specified by:
inin interfaceExpression- Returns:
- conditional predicate
-
in
public Predicate in(Enum<?>... enums)
Description copied from interface:ExpressionCreate a predicate for testing whether the expression value is a member of the argument list.- Specified by:
inin interfaceExpression- Returns:
- conditional predicate
-
in
public Predicate in(Class... classes)
Description copied from interface:ExpressionCreate a predicate for testing whether the expression value is a member of the argument list.- Specified by:
inin interfaceExpression- Returns:
- conditional predicate
-
in
public Predicate in(Expression... params)
Description copied from interface:ExpressionCreate a predicate for testing whether the expression value is a member of the argument list.- Specified by:
inin interfaceExpression- Returns:
- conditional predicate
-
in
public Predicate in(Subquery subquery)
Description copied from interface:ExpressionCreate a predicate for testing whether the expression value is a member of a subquery result.- Specified by:
inin interfaceExpression- Returns:
- conditional predicate
-
isNull
public Predicate isNull()
Description copied from interface:ExpressionCreate a predicate for testing whether the value of the expression is null.- Specified by:
isNullin interfaceExpression- Returns:
- conditional predicate
-
length
public Expression length()
Description copied from interface:ExpressionString length This method must be invoked on an expression corresponding to a string.- Specified by:
lengthin interfaceExpression- Returns:
- expression denoting the length of the string.
-
locate
public Expression locate(String str)
Description copied from interface:ExpressionLocate a string contained within the string corresponding to the expression on which the method was invoked. The search is started at position 1 (first string position). This method must be invoked on an expression corresponding to a string.- Specified by:
locatein interfaceExpression- Parameters:
str- - string to be located- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
public Expression locate(Expression expr)
Description copied from interface:ExpressionLocate a string contained within the string corresponding to the expression on which the method was invoked. The search is started at position 1 (first string position). This method must be invoked on an expression corresponding to a string.- Specified by:
locatein interfaceExpression- Parameters:
expr- - expression corresponding to the string to be located- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
public Expression locate(String str, int position)
Description copied from interface:ExpressionLocate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position. This method must be invoked on an expression corresponding to a string.- Specified by:
locatein interfaceExpression- Parameters:
str- - string to be locatedposition- - position at which to start the search- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
public Expression locate(String str, Expression position)
Description copied from interface:ExpressionLocate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position. This method must be invoked on an expression corresponding to a string.- Specified by:
locatein interfaceExpression- Parameters:
str- - string to be locatedposition- - expression corresponding to position at which to start the search- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
public Expression locate(Expression str, int position)
Description copied from interface:ExpressionLocate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position. This method must be invoked on an expression corresponding to a string.- Specified by:
locatein interfaceExpression- Parameters:
str- - expression corresponding to the string to be locatedposition- - position at which to start the search- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
public Expression locate(Expression str, Expression position)
Description copied from interface:ExpressionLocate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position. This method must be invoked on an expression corresponding to a string.- Specified by:
locatein interfaceExpression- Parameters:
str- - expression corresponding to the string to be locatedposition- - expression corresponding to position at which to start the search- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
lower
public Expression lower()
Description copied from interface:ExpressionConvert string to lowercase. This method must be invoked on an expression corresponding to a string.- Specified by:
lowerin interfaceExpression- Returns:
- expression denoting the string in lowercase
-
member
public Predicate member(PathExpression arg)
Description copied from interface:ExpressionCreate a predicate for testing whether the expression is a member of the association or element collection denoted by the path expression. The argument must correspond to a collection-valued association or element collection of like type.- Specified by:
memberin interfaceExpression- Parameters:
arg- - a path expression that specifies a collection-valued association or an element collection- Returns:
- conditional predicate
-
minus
public Expression minus()
Description copied from interface:ExpressionUnary minus. This method must be invoked on an expression corresponding to a number.- Specified by:
minusin interfaceExpression- Returns:
- expression denoting the unary minus of the expression
-
minus
public Expression minus(Number num)
Description copied from interface:ExpressionSubtraction. This method must be invoked on an expression corresponding to a number.- Specified by:
minusin interfaceExpression- Parameters:
num- - subtrahend- Returns:
- expression denoting the result of subtracting the argument from the number corresponding to the expression on which the method was invoked.
-
minus
public Expression minus(Expression expr)
Description copied from interface:ExpressionSubtraction. This method must be invoked on an expression corresponding to a number.- Specified by:
minusin interfaceExpression- Parameters:
expr- - expression corresponding to subtrahend- Returns:
- expression denoting the result of subtracting the number denoted by the argument from the number corresponding to the expression on which the method was invoked.
-
mod
public Expression mod(int num)
Description copied from interface:ExpressionModulo operation. This must be invoked on an expression corresponding to an integer value- Specified by:
modin interfaceExpression- Parameters:
num- - integer divisor- Returns:
- expression corresponding to the integer remainder of the division of the integer corresponding to the expression on which the method was invoked by the argument.
-
mod
public Expression mod(Expression expr)
Description copied from interface:ExpressionModulo operation. This must be invoked on an expression corresponding to an integer value- Specified by:
modin interfaceExpression- Parameters:
expr- - expression corresponding to integer divisor- Returns:
- expression corresponding to the integer remainder of the division of the integer corresponding to the expression on which the method was invoked by the argument.
-
plus
public Expression plus(Number num)
Description copied from interface:ExpressionAddition. This method must be invoked on an expression corresponding to a number.- Specified by:
plusin interfaceExpression- Parameters:
num- - number to be added- Returns:
- expression denoting the sum
-
plus
public Expression plus(Expression expr)
Description copied from interface:ExpressionAddition. This method must be invoked on an expression corresponding to a number.- Specified by:
plusin interfaceExpression- Parameters:
expr- - expression corresponding to number to be added- Returns:
- expression denoting the sum
-
sqrt
public Expression sqrt()
Description copied from interface:ExpressionSquare root. This method must be invoked on an expression corresponding to a number.- Specified by:
sqrtin interfaceExpression- Returns:
- expression corresponding to the square root
-
substring
public Expression substring(int start)
Description copied from interface:ExpressionExtract a substring starting at specified position through to the end of the string. This method must be invoked on an expression corresponding to a string.- Specified by:
substringin interfaceExpression- Parameters:
start- - start position (1 indicates first position)- Returns:
- expression denoting the extracted substring
-
substring
public Expression substring(Expression start)
Description copied from interface:ExpressionExtract a substring starting at specified position through to the end of the string. This method must be invoked on an expression corresponding to a string.- Specified by:
substringin interfaceExpression- Parameters:
start- - expression denoting start position (1 indicates first position)- Returns:
- expression denoting the extracted substring
-
substring
public Expression substring(int start, int len)
Description copied from interface:ExpressionExtract a substring. This method must be invoked on an expression corresponding to a string.- Specified by:
substringin interfaceExpression- Parameters:
start- - start position (1 indicates first position)len- - length of the substring to be returned- Returns:
- expression denoting the extracted substring
-
substring
public Expression substring(int start, Expression len)
Description copied from interface:ExpressionExtract a substring. This method must be invoked on an expression corresponding to a string.- Specified by:
substringin interfaceExpression- Parameters:
start- - start position (1 indicates first position)len- - expression denoting length of the substring to return- Returns:
- expression denoting the extracted substring
-
substring
public Expression substring(Expression start, int len)
Description copied from interface:ExpressionExtract a substring. This method must be invoked on an expression corresponding to a string.- Specified by:
substringin interfaceExpression- Parameters:
start- - expression denoting start position (1 indicates first position)len- - length of the substring to return- Returns:
- expression denoting the extracted substring
-
substring
public Expression substring(Expression start, Expression len)
Description copied from interface:ExpressionExtract a substring. This method must be invoked on an expression corresponding to a string.- Specified by:
substringin interfaceExpression- Parameters:
start- - expression denoting start position (1 indicates first position)len- - expression denoting length of the substring to return- Returns:
- expression denoting the extracted substring
-
times
public Expression times(Number num)
Description copied from interface:ExpressionMultiplication. This method must be invoked on an expression corresponding to a number.- Specified by:
timesin interfaceExpression- Parameters:
num- - multiplier- Returns:
- expression denoting the result of multiplying the argument with the number corresponding to the expression on which the method was invoked.
-
times
public Expression times(Expression expr)
Description copied from interface:ExpressionMultiplication. This method must be invoked on an expression corresponding to a number.- Specified by:
timesin interfaceExpression- Parameters:
expr- - expression corresponding to the multiplier- Returns:
- expression denoting the result of multiplying the number denoted by the argument with the number corresponding to the expression on which the method was invoked.
-
trim
public Expression trim()
Description copied from interface:ExpressionTrim leading and trailing blanks. This method must be invoked on an expression corresponding to a string.- Specified by:
trimin interfaceExpression- Returns:
- expression denoting trimmed string
-
trim
public Expression trim(TrimSpec spec)
Description copied from interface:ExpressionTrim leading, trailing blanks (or both) as specified by trim spec. This method must be invoked on an expression corresponding to a string.- Specified by:
trimin interfaceExpression- Parameters:
spec- - trim specification- Returns:
- expression denoting trimmed string
-
trim
public Expression trim(char c)
Description copied from interface:ExpressionTrim leading and trailing occurrences of character from the string. This method must be invoked on an expression corresponding to a string.- Specified by:
trimin interfaceExpression- Parameters:
c- - character to be trimmed- Returns:
- expression denoting trimmed string
-
trim
public Expression trim(char c, TrimSpec spec)
Description copied from interface:ExpressionTrim occurrences of the character from leading or trailing (or both) positions of the string, as specified by trim spec. This method must be invoked on an expression corresponding to a string.- Specified by:
trimin interfaceExpression- Parameters:
c- - character to be trimmedspec- - trim specification- Returns:
- expression denoting trimmed string
-
trim
public Expression trim(Expression expr)
Description copied from interface:ExpressionTrim leading and trailing occurrences of character specified by the expression argument from the string. This method must be invoked on an expression corresponding to a string.- Specified by:
trimin interfaceExpression- Parameters:
expr- - expression corresponding to the character to be trimmed- Returns:
- expression denoting trimmed string
-
trim
public Expression trim(Expression expr, TrimSpec spec)
Description copied from interface:ExpressionTrim occurrences of the character specified by the expression argument from leading or trailing (or both) positions of the string, as specified by trim spec. This method must be invoked on an expression corresponding to a string.- Specified by:
trimin interfaceExpression- Parameters:
expr- - expression corresponding to the character to be trimmedspec- - trim specification- Returns:
- expression denoting trimmed string
-
upper
public Expression upper()
Description copied from interface:ExpressionConvert string to uppercase. This method must be invoked on an expression corresponding to a string.- Specified by:
upperin interfaceExpression- Returns:
- expression denoting the string in uppercase
-
asc
public OrderByItem asc()
Description copied from interface:SelectItemReturn an OrderByItem referencing the SelectItem and specifying ascending ordering. The SelectItem must correspond to an orderable value.- Specified by:
ascin interfaceSelectItem- Returns:
- order-by item
-
desc
public OrderByItem desc()
Description copied from interface:SelectItemReturn an OrderByItem referencing the SelectItem and specifying descending ordering. The SelectItem must correspond to an orderable value.- Specified by:
descin interfaceSelectItem- Returns:
- order-by item
-
between
public Predicate between(PredicateOperand arg1, PredicateOperand arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - PredicateOperand instance or parameterarg2- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
between
public Predicate between(PredicateOperand arg1, Number arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - PredicateOperand instance or parameterarg2- - numeric- Returns:
- conditional predicate
-
between
public Predicate between(Number arg1, PredicateOperand arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - numericarg2- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
between
public Predicate between(Number arg1, Number arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - numericarg2- - numeric- Returns:
- conditional predicate
-
between
public Predicate between(PredicateOperand arg1, String arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - PredicateOperand instance or parameterarg2- - string- Returns:
- conditional predicate
-
between
public Predicate between(String arg1, PredicateOperand arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - stringarg2- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
between
public Predicate between(String arg1, String arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - stringarg2- - string- Returns:
- conditional predicate
-
between
public Predicate between(PredicateOperand arg1, Date arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - PredicateOperand instance or parameterarg2- - date- Returns:
- conditional predicate
-
between
public Predicate between(Date arg1, PredicateOperand arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - datearg2- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
between
public Predicate between(Date arg1, Date arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - datearg2- - date- Returns:
- conditional predicate
-
between
public Predicate between(PredicateOperand arg1, Calendar arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - PredicateOperand instance or parameterarg2- - calendar- Returns:
- conditional predicate
-
between
public Predicate between(Calendar arg1, PredicateOperand arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - calendararg2- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
between
public Predicate between(Calendar arg1, Calendar arg2)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand lies between (inclusive) the two arguments.- Specified by:
betweenin interfacePredicateOperand- Parameters:
arg1- - calendararg2- - calendar- Returns:
- conditional predicate
-
equal
public Predicate equal(PredicateOperand arg)
Description copied from interface:PredicateOperandCreate a predicate for testing equality with the specified argument.- Specified by:
equalin interfacePredicateOperand- Parameters:
arg- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
equal
public Predicate equal(Class cls)
Description copied from interface:PredicateOperandCreate a predicate for testing equality with the specified argument.- Specified by:
equalin interfacePredicateOperand- Parameters:
cls- - entity class- Returns:
- conditional predicate
-
equal
public Predicate equal(Number arg)
Description copied from interface:PredicateOperandCreate a predicate for testing equality with the specified argument.- Specified by:
equalin interfacePredicateOperand- Parameters:
arg- - numeric- Returns:
- conditional predicate
-
equal
public Predicate equal(String arg)
Description copied from interface:PredicateOperandCreate a predicate for testing equality with the specified argument.- Specified by:
equalin interfacePredicateOperand- Parameters:
arg- - string value- Returns:
- conditional predicate
-
equal
public Predicate equal(boolean arg)
Description copied from interface:PredicateOperandCreate a predicate for testing equality with the specified argument.- Specified by:
equalin interfacePredicateOperand- Parameters:
arg- - boolean value- Returns:
- conditional predicate
-
equal
public Predicate equal(Date arg)
Description copied from interface:PredicateOperandCreate a predicate for testing equality with the specified argument.- Specified by:
equalin interfacePredicateOperand- Parameters:
arg- - date- Returns:
- conditional predicate
-
equal
public Predicate equal(Calendar arg)
Description copied from interface:PredicateOperandCreate a predicate for testing equality with the specified argument.- Specified by:
equalin interfacePredicateOperand- Parameters:
arg- - calendar- Returns:
- conditional predicate
-
equal
public Predicate equal(Enum<?> e)
Description copied from interface:PredicateOperandCreate a predicate for testing equality with the specified argument.- Specified by:
equalin interfacePredicateOperand- Parameters:
e- - enum- Returns:
- conditional predicate
-
greaterEqual
public Predicate greaterEqual(PredicateOperand arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than or equal to the argument.- Specified by:
greaterEqualin interfacePredicateOperand- Parameters:
arg- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
greaterEqual
public Predicate greaterEqual(Number arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than or equal to the argument.- Specified by:
greaterEqualin interfacePredicateOperand- Parameters:
arg- - numeric- Returns:
- conditional predicate
-
greaterEqual
public Predicate greaterEqual(String arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than or equal to the argument.- Specified by:
greaterEqualin interfacePredicateOperand- Parameters:
arg- - string- Returns:
- conditional predicate
-
greaterEqual
public Predicate greaterEqual(Date arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than or equal to the argument.- Specified by:
greaterEqualin interfacePredicateOperand- Parameters:
arg- - date- Returns:
- conditional predicate
-
greaterEqual
public Predicate greaterEqual(Calendar arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than or equal to the argument.- Specified by:
greaterEqualin interfacePredicateOperand- Parameters:
arg- - calendar- Returns:
- conditional predicate
-
greaterThan
public Predicate greaterThan(PredicateOperand arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than the argument.- Specified by:
greaterThanin interfacePredicateOperand- Parameters:
arg- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
greaterThan
public Predicate greaterThan(Number arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than the argument.- Specified by:
greaterThanin interfacePredicateOperand- Parameters:
arg- - numeric- Returns:
- conditional predicate
-
greaterThan
public Predicate greaterThan(String arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than the argument.- Specified by:
greaterThanin interfacePredicateOperand- Parameters:
arg- - string- Returns:
- conditional predicate
-
greaterThan
public Predicate greaterThan(Date arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than the argument.- Specified by:
greaterThanin interfacePredicateOperand- Parameters:
arg- - date- Returns:
- conditional predicate
-
greaterThan
public Predicate greaterThan(Calendar arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is greater than the argument.- Specified by:
greaterThanin interfacePredicateOperand- Parameters:
arg- - calendar- Returns:
- conditional predicate
-
lessEqual
public Predicate lessEqual(PredicateOperand arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than or equal to the argument.- Specified by:
lessEqualin interfacePredicateOperand- Parameters:
arg- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
lessEqual
public Predicate lessEqual(Number arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than or equal to the argument.- Specified by:
lessEqualin interfacePredicateOperand- Parameters:
arg- - numeric- Returns:
- conditional predicate
-
lessEqual
public Predicate lessEqual(String arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than or equal to the argument.- Specified by:
lessEqualin interfacePredicateOperand- Parameters:
arg- - string- Returns:
- conditional predicate
-
lessEqual
public Predicate lessEqual(Date arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than or equal to the argument.- Specified by:
lessEqualin interfacePredicateOperand- Parameters:
arg- - date- Returns:
- conditional predicate
-
lessEqual
public Predicate lessEqual(Calendar arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than or equal to the argument.- Specified by:
lessEqualin interfacePredicateOperand- Parameters:
arg- - calendar- Returns:
- conditional predicate
-
lessThan
public Predicate lessThan(PredicateOperand arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than the argument.- Specified by:
lessThanin interfacePredicateOperand- Parameters:
arg- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
lessThan
public Predicate lessThan(Number arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than the argument.- Specified by:
lessThanin interfacePredicateOperand- Parameters:
arg- - numeric- Returns:
- conditional predicate
-
lessThan
public Predicate lessThan(String arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than the argument.- Specified by:
lessThanin interfacePredicateOperand- Parameters:
arg- - string- Returns:
- conditional predicate
-
lessThan
public Predicate lessThan(Date arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than the argument.- Specified by:
lessThanin interfacePredicateOperand- Parameters:
arg- - date- Returns:
- conditional predicate
-
lessThan
public Predicate lessThan(Calendar arg)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand is less than the argument.- Specified by:
lessThanin interfacePredicateOperand- Parameters:
arg- - calendar- Returns:
- conditional predicate
-
like
public Predicate like(PredicateOperand pattern)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand satisfies the given pattern.- Specified by:
likein interfacePredicateOperand- Returns:
- conditional predicate
-
like
public Predicate like(PredicateOperand pattern, PredicateOperand escChar)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand satisfies the given pattern.- Specified by:
likein interfacePredicateOperand- Returns:
- conditional predicate
-
like
public Predicate like(PredicateOperand pattern, char escapeChar)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand satisfies the given pattern.- Specified by:
likein interfacePredicateOperand- Returns:
- conditional predicate
-
like
public Predicate like(String pattern)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand satisfies the given pattern.- Specified by:
likein interfacePredicateOperand- Returns:
- conditional predicate
-
like
public Predicate like(String pattern, PredicateOperand escapeChar)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand satisfies the given pattern.- Specified by:
likein interfacePredicateOperand- Returns:
- conditional predicate
-
like
public Predicate like(String pattern, char escChar)
Description copied from interface:PredicateOperandCreate a predicate for testing whether the PredicateOperand satisfies the given pattern.- Specified by:
likein interfacePredicateOperand- Returns:
- conditional predicate
-
notEqual
public Predicate notEqual(PredicateOperand arg)
Description copied from interface:PredicateOperandCreate a predicate for testing inequality with the specified argument.- Specified by:
notEqualin interfacePredicateOperand- Parameters:
arg- - PredicateOperand instance or parameter- Returns:
- conditional predicate
-
notEqual
public Predicate notEqual(Class cls)
Description copied from interface:PredicateOperandCreate a predicate for testing inequality with the specified argument.- Specified by:
notEqualin interfacePredicateOperand- Parameters:
cls- - entity class- Returns:
- conditional predicate
-
notEqual
public Predicate notEqual(Number arg)
Description copied from interface:PredicateOperandCreate a predicate for testing inequality with the specified argument.- Specified by:
notEqualin interfacePredicateOperand- Parameters:
arg- - numberic value- Returns:
- conditional predicate
-
notEqual
public Predicate notEqual(String arg)
Description copied from interface:PredicateOperandCreate a predicate for testing inequality with the specified argument.- Specified by:
notEqualin interfacePredicateOperand- Parameters:
arg- - string value- Returns:
- conditional predicate
-
notEqual
public Predicate notEqual(boolean arg)
Description copied from interface:PredicateOperandCreate a predicate for testing inequality with the specified argument.- Specified by:
notEqualin interfacePredicateOperand- Parameters:
arg- - boolean value- Returns:
- conditional predicate
-
notEqual
public Predicate notEqual(Date arg)
Description copied from interface:PredicateOperandCreate a predicate for testing inequality with the specified argument.- Specified by:
notEqualin interfacePredicateOperand- Parameters:
arg- - date- Returns:
- conditional predicate
-
notEqual
public Predicate notEqual(Calendar arg)
Description copied from interface:PredicateOperandCreate a predicate for testing inequality with the specified argument.- Specified by:
notEqualin interfacePredicateOperand- Parameters:
arg- - calendar- Returns:
- conditional predicate
-
notEqual
public Predicate notEqual(Enum<?> e)
Description copied from interface:PredicateOperandCreate a predicate for testing inequality with the specified argument.- Specified by:
notEqualin interfacePredicateOperand- Parameters:
e- - enum- Returns:
- conditional predicate
-
getAliasHint
public String getAliasHint(org.apache.openjpa.persistence.query.AliasContext ctx)
Description copied from interface:VisitableGets the hint to be used while creating alias.- Specified by:
getAliasHintin interfaceVisitable
-
asExpression
public String asExpression(org.apache.openjpa.persistence.query.AliasContext ctx)
Description copied from interface:VisitableGet a JPQL fragment as used in WHERE clause.- Specified by:
asExpressionin interfaceVisitable
-
asProjection
public String asProjection(org.apache.openjpa.persistence.query.AliasContext ctx)
Description copied from interface:VisitableGets the string representation in SELECT projection.- Specified by:
asProjectionin interfaceVisitable
-
asJoinable
public String asJoinable(org.apache.openjpa.persistence.query.AliasContext ctx)
Description copied from interface:VisitableGets the string representation in FROM clause.- Specified by:
asJoinablein interfaceVisitable
-
-