|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.persistence.query.AbstractVisitable
org.apache.openjpa.persistence.query.ExpressionImpl
org.apache.openjpa.persistence.query.QueryDefinitionImpl
public class QueryDefinitionImpl
Implements QueryDefinition.
| Nested Class Summary | |
|---|---|
(package private) static class |
QueryDefinitionImpl.DomainSorter
|
| Field Summary | |
|---|---|
protected static Localizer |
_loc
|
| Fields inherited from class org.apache.openjpa.persistence.query.AbstractVisitable |
|---|
CLOSE_BRACE, COMMA, EMPTY, OPEN_BRACE, SPACE |
| Constructor Summary | |
|---|---|
protected |
QueryDefinitionImpl(QueryBuilderImpl builder)
|
| Method Summary | ||
|---|---|---|
protected
|
addDomain(T path)
|
|
DomainObject |
addRoot(Class cls)
Root domain object has no parent, no path but a non-null Class. |
|
DomainObject |
addSubqueryRoot(PathExpression path)
Add a root derived from a domain object of the containing query definition to a query definition used as a subquery. |
|
Subquery |
all()
Use the query definition object in a subquery in an all expression. |
|
Subquery |
any()
Use the query definition object in a subquery in an any expression. |
|
String |
asExpression(AliasContext ctx)
Get a JPQL fragment as used in WHERE clause. |
|
String |
asProjection(AliasContext ctx)
Gets the string representation in SELECT projection. |
|
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. |
|
Predicate |
exists()
Use the query definition instance as a subquery in an exists predicate. |
|
void |
fillBuffer(String header,
StringBuilder buffer,
AliasContext ctx,
List list,
org.apache.openjpa.persistence.query.QueryDefinitionImpl.Visit visit)
|
|
void |
fillBuffer(String header,
StringBuilder buffer,
AliasContext ctx,
Predicate p)
|
|
CaseExpression |
generalCase()
Create an empty general case expression. |
|
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. |
|
(package private) boolean |
hasDomain(PathExpression path)
|
|
QueryDefinition |
having(Predicate predicate)
Specify the restrictions over the groups of a query. |
|
Expression |
literal(boolean b)
Create an Expression corresponding to a boolean value. |
|
Expression |
literal(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> items)
Specify the objects / values to be returned. |
|
QueryDefinition |
select(SelectItem... items)
Specify the objects / values to be returned. |
|
QueryDefinition |
selectDistinct(List<SelectItem> items)
Specify the objects / values to be returned. |
|
QueryDefinition |
selectDistinct(SelectItem... items)
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()
Use the query definition object in a subquery in a some expression. |
|
QueryDefinition |
where(Predicate predicate)
Modifies the query definition to restrict the result of the query according to the specified predicate. |
|
| 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 |
|---|
asJoinable |
| 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.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.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.Visitable |
|---|
asJoinable |
| Field Detail |
|---|
protected static Localizer _loc
| Constructor Detail |
|---|
protected QueryDefinitionImpl(QueryBuilderImpl builder)
builder - | Method Detail |
|---|
public DomainObject addRoot(Class cls)
addRoot in interface QueryDefinitioncls - -
an entity class
public DomainObject addSubqueryRoot(PathExpression path)
QueryDefinition
addSubqueryRoot in interface QueryDefinitionpath - -
path expression corresponding to the domain object used to
derive the subquery root.
boolean hasDomain(PathExpression path)
protected <T extends AbstractDomainObject> T addDomain(T path)
public Subquery all()
QueryDefinition
all in interface QueryDefinitionpublic Subquery any()
QueryDefinition
any in interface QueryDefinitionpublic Expression coalesce(Expression... exp)
QueryDefinition
coalesce in interface QueryDefinitionexp - -
expressions to be used for testing against null
public Expression coalesce(String... exp)
QueryDefinition
coalesce in interface QueryDefinitionexp - -
expressions to be used for testing against null
public Expression coalesce(Date... exp)
QueryDefinition
coalesce in interface QueryDefinitionexp - -
expressions to be used for testing against null
public Expression coalesce(Calendar... exp)
QueryDefinition
coalesce in interface QueryDefinitionexp - -
expressions to be used for testing against null
public Expression currentDate()
QueryDefinition
currentDate in interface QueryDefinitionpublic Expression currentTime()
QueryDefinition
currentTime in interface QueryDefinitionpublic Expression currentTimestamp()
QueryDefinition
currentTimestamp in interface QueryDefinitionpublic Predicate exists()
QueryDefinition
exists in interface QueryDefinitionpublic CaseExpression generalCase()
QueryDefinition
generalCase in interface QueryDefinitionpublic QueryDefinition groupBy(PathExpression... pathExprs)
QueryDefinition
groupBy in interface QueryDefinitionpublic QueryDefinition groupBy(List<PathExpression> pathExprList)
QueryDefinition
groupBy in interface QueryDefinitionpublic QueryDefinition having(Predicate predicate)
QueryDefinition
having in interface QueryDefinitionpublic Expression literal(String s)
QueryDefinition
literal in interface QueryDefinitions - -
string value
public Expression literal(Number n)
QueryDefinition
literal in interface QueryDefinitionn - -
numeric value
public Expression literal(boolean b)
QueryDefinition
literal in interface QueryDefinitionb - -
boolean value
public Expression literal(Calendar c)
QueryDefinition
literal in interface QueryDefinitionc - -
Calendar value
public Expression literal(Date d)
QueryDefinition
literal in interface QueryDefinitiond - -
Date value
public Expression literal(char c)
QueryDefinition
literal in interface QueryDefinitionpublic Expression literal(Class cls)
QueryDefinition
literal in interface QueryDefinitioncls - -
entity class
public Expression literal(Enum<?> e)
QueryDefinition
literal in interface QueryDefinitione - -
enum
public Expression nullLiteral()
QueryDefinition
nullLiteral in interface QueryDefinition
public SelectItem newInstance(Class cls,
SelectItem... args)
QueryDefinition
newInstance in interface QueryDefinitioncls - -
a class with the correponding constructorargs - -
select items that correspond to result types that are valid
as arguments to the constructor
public Expression nullif(Expression exp1,
Expression exp2)
QueryDefinition
nullif in interface QueryDefinition
public Expression nullif(Number arg1,
Number arg2)
QueryDefinition
nullif in interface QueryDefinition
public Expression nullif(String arg1,
String arg2)
QueryDefinition
nullif in interface QueryDefinitionarg2 - Criteria API Java Persistence 2.0, Public Review Draft
Criteria API Interfaces 10/31/08 158 JSR-317 Public Review
Draft Sun Microsystems, Inc.
public Expression nullif(Date arg1,
Date arg2)
QueryDefinition
nullif in interface QueryDefinition
public Expression nullif(Calendar arg1,
Calendar arg2)
QueryDefinition
nullif in interface QueryDefinition
public Expression nullif(Class arg1,
Class arg2)
QueryDefinition
nullif in interface QueryDefinition
public Expression nullif(Enum<?> arg1,
Enum<?> arg2)
QueryDefinition
nullif in interface QueryDefinitionpublic QueryDefinition orderBy(OrderByItem... orderByItems)
QueryDefinition
orderBy in interface QueryDefinitionorderByItems - -
one or more OrderByItem instances
public QueryDefinition orderBy(List<OrderByItem> orderByItemList)
QueryDefinition
orderBy in interface QueryDefinitionorderByItemList - -
a list containing one or more OrderByItem
instances
public Expression param(String name)
QueryDefinition
param in interface QueryDefinitionpublic Predicate predicate(boolean b)
QueryDefinition
predicate in interface QueryDefinitionb - boolean value
public QueryDefinition select(SelectItem... items)
QueryDefinition
select in interface QueryDefinitionitems - -
one or more SelectItem instances
public QueryDefinition select(List<SelectItem> items)
QueryDefinition
select in interface QueryDefinitionitems - -
a list containing one or more SelectItem instances
public QueryDefinition selectDistinct(SelectItem... items)
QueryDefinition
selectDistinct in interface QueryDefinitionitems - -
one or more SelectItem instances
public QueryDefinition selectDistinct(List<SelectItem> items)
QueryDefinition
selectDistinct in interface QueryDefinitionitems - -
a list containing one or more SelectItem instances
public CaseExpression simpleCase(Expression caseOperand)
QueryDefinition
simpleCase in interface QueryDefinitioncaseOperand - -
expression used for testing against the when scalar
expressions
public CaseExpression simpleCase(Number caseOperand)
QueryDefinition
simpleCase in interface QueryDefinitioncaseOperand - -
numeric value used for testing against the when scalar
expressions
public CaseExpression simpleCase(String caseOperand)
QueryDefinition
simpleCase in interface QueryDefinitioncaseOperand - -
value used for testing against the when scalar
expressions
public CaseExpression simpleCase(Date caseOperand)
QueryDefinition
simpleCase in interface QueryDefinitioncaseOperand - -
value used for testing against the when scalar
expressions
public CaseExpression simpleCase(Calendar caseOperand)
QueryDefinition
simpleCase in interface QueryDefinitioncaseOperand - -
value used for testing against the when scalar
expressions
public CaseExpression simpleCase(Class caseOperand)
QueryDefinition
simpleCase in interface QueryDefinitioncaseOperand - -
value used for testing against the when scalar
expressions
public CaseExpression simpleCase(Enum<?> caseOperand)
QueryDefinition
simpleCase in interface QueryDefinitioncaseOperand - -
value used for testing against the when scalar
expressions
public Subquery some()
QueryDefinition
some in interface QueryDefinitionpublic QueryDefinition where(Predicate predicate)
QueryDefinition
where in interface QueryDefinitionpredicate - -
a simple or compound conditional predicate
public String asExpression(AliasContext ctx)
Visitable
asExpression in interface VisitableasExpression in class AbstractVisitablepublic String asProjection(AliasContext ctx)
Visitable
asProjection in interface VisitableasProjection in class AbstractVisitable
public void fillBuffer(String header,
StringBuilder buffer,
AliasContext ctx,
List list,
org.apache.openjpa.persistence.query.QueryDefinitionImpl.Visit visit)
public void fillBuffer(String header,
StringBuilder buffer,
AliasContext ctx,
Predicate p)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||