public class ObjectExpression extends SQLExpression
Let's take an example. We have classes A and B, and A contains a reference to B "b". If we do a JDOQL query for class A of "b == value" then "b" is interpreted first and an ObjectExpression is created to represent that object (of type B).
SQLExpression.ColumnExpressionList
lowestOperator, mapping, parameterName, st, stmt, subExprs, table
Constructor and Description |
---|
ObjectExpression(SQLStatement stmt,
JavaTypeMapping mapping,
String functionName,
List args)
Generates statement as "FUNCTION_NAME(arg [,argN])".
|
ObjectExpression(SQLStatement stmt,
JavaTypeMapping mapping,
String functionName,
List args,
List types)
Generates statement as "FUNCTION_NAME(arg [AS type] [,argN [AS typeN]])".
|
ObjectExpression(SQLStatement stmt,
SQLTable table,
JavaTypeMapping mapping)
Constructor for an SQL expression for a (field) mapping in a specified table.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addSubexpressionsToRelatedExpression(SQLExpression expr)
Updates the supplied expression with sub-expressions of consistent types to this expression.
|
SQLExpression |
cast(SQLExpression expr)
Cast operator.
|
BooleanExpression |
eq(SQLExpression expr)
Equals operator.
|
BooleanExpression |
ge(SQLExpression expr)
Relational operator (greater than or equals)
|
BooleanExpression |
gt(SQLExpression expr)
Relational operator (greater than)
|
BooleanExpression |
in(SQLExpression expr,
boolean not)
In expression.
|
SQLExpression |
invoke(String methodName,
List args)
Invocation of a method on this expression.
|
BooleanExpression |
is(SQLExpression expr,
boolean not)
An "is" (instanceOf) expression, providing a BooleanExpression whether this expression
is an instanceof the provided type.
|
BooleanExpression |
le(SQLExpression expr)
Relational operator (lower than or equals)
|
BooleanExpression |
lt(SQLExpression expr)
Relational operator (lower than)
|
BooleanExpression |
ne(SQLExpression expr)
Not equals operator.
|
protected BooleanExpression |
processComparisonOfImplementationWithReference(SQLExpression refExpr,
SQLExpression implExpr,
boolean negate) |
void |
useFirstColumnOnly()
Method to change the expression to use only the first column.
|
add, and, com, distinct, div, encloseInParentheses, eor, getJavaTypeMapping, getLowestOperator, getNumberOfSubExpressions, getParameterName, getSQLStatement, getSQLTable, getSubExpression, ior, isParameter, mod, mul, neg, not, setJavaTypeMapping, sub, toSQLText
public ObjectExpression(SQLStatement stmt, SQLTable table, JavaTypeMapping mapping)
stmt
- The statementtable
- The table in the statementmapping
- The mapping for the fieldpublic ObjectExpression(SQLStatement stmt, JavaTypeMapping mapping, String functionName, List args)
stmt
- The statementmapping
- Mapping to usefunctionName
- Name of functionargs
- SQLExpression listpublic ObjectExpression(SQLStatement stmt, JavaTypeMapping mapping, String functionName, List args, List types)
stmt
- The statementmapping
- Mapping to usefunctionName
- Name of functionargs
- SQLExpression listtypes
- Optional String/SQLExpression list of types for the argspublic void useFirstColumnOnly()
public BooleanExpression eq(SQLExpression expr)
eq
in class SQLExpression
expr
- The expression we compare with (the right-hand-side in the query)protected BooleanExpression processComparisonOfImplementationWithReference(SQLExpression refExpr, SQLExpression implExpr, boolean negate)
public BooleanExpression ne(SQLExpression expr)
ne
in class SQLExpression
expr
- The expression we compare with (the right-hand-side in the query)protected void addSubexpressionsToRelatedExpression(SQLExpression expr)
expr
- The expressionpublic BooleanExpression in(SQLExpression expr, boolean not)
SQLExpression
expr
in
in class SQLExpression
expr
- the right-hand expressionnot
- Whether we really want "not in"public BooleanExpression lt(SQLExpression expr)
SQLExpression
lt
in class SQLExpression
expr
- the right-hand operandpublic BooleanExpression le(SQLExpression expr)
SQLExpression
le
in class SQLExpression
expr
- the right-hand operandpublic BooleanExpression gt(SQLExpression expr)
SQLExpression
gt
in class SQLExpression
expr
- the right-hand operandpublic BooleanExpression ge(SQLExpression expr)
SQLExpression
ge
in class SQLExpression
expr
- the right-hand operandpublic SQLExpression cast(SQLExpression expr)
cast
in class SQLExpression
expr
- Expression representing the type to cast topublic BooleanExpression is(SQLExpression expr, boolean not)
is
in class SQLExpression
expr
- The expression representing the typenot
- Whether the operator is "!instanceof"public SQLExpression invoke(String methodName, List args)
SQLExpression
invoke
in class SQLExpression
methodName
- name of the method to invokeargs
- Args to this method (if any)Copyright © 2015. All rights reserved.