|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.triactive.jdo.store.sql.expr.AbstractSqlExpression
Nested Class Summary | |
static interface |
AbstractSqlExpression.Body
The "body" of an SQL expression. |
static interface |
AbstractSqlExpression.CompoundExpression
The "body" of an SQL expression made up of one or more component SQL expressions. |
static interface |
AbstractSqlExpression.SimpleColumnReference
The "body" of an SQL expression which references no more than one column. |
static interface |
AbstractSqlExpression.SubqueryExpression
The "body" of an SQL expression made up of a subquery. |
Field Summary | |
protected AbstractSqlExpression.Body |
body
|
protected QueryStatement |
qs
|
Method Summary | |
SqlExpression |
accessField(java.lang.String fieldName)
Returns a new expression representing "this.fieldName". |
SqlExpression |
add(SqlExpression expr)
Returns a new expression representing "this + expr". |
BooleanExpression |
and(SqlExpression expr)
Returns a new expression representing "this && expr". |
SqlExpression |
callMethod(java.lang.String methodName,
java.util.List arguments)
Returns a new expression representing "this.methodName(arguments)". |
SqlExpression |
cast(java.lang.Class type)
Returns a new expression representing this expression cast to the given data type. |
SqlExpression |
com()
Returns a new expression representing "~this". |
SqlExpression |
div(SqlExpression expr)
Returns a new expression representing "this / expr". |
BooleanExpression |
eor(SqlExpression expr)
Returns a new expression representing "this ^ expr". |
BooleanExpression |
eq(SqlExpression expr)
Returns a new expression representing "this == expr". |
ColumnMapping |
getColumnMapping()
Returns the preferred mapping for this expression if it is a column mapping. |
java.lang.Class |
getJavaType()
Returns the corresponding Java type of this expression. |
Mapping |
getMapping()
Returns the preferred mapping for mapping this expression to/from Java objects. |
QueryStatement |
getQueryStatement()
Returns the query statement to which this expression belongs. |
java.util.Set |
getReferencedColumns()
Returns a set containing all the query columns referenced by this expression. |
BooleanExpression |
gt(SqlExpression expr)
Returns a new expression representing "this > expr". |
BooleanExpression |
gteq(SqlExpression expr)
Returns a new expression representing "this >= expr". |
static QueryStatement |
innermostQuery(java.util.Collection c)
Returns the innermost query among all the given SqlExpression. |
static QueryStatement |
innermostQuery(SqlExpression expr1,
SqlExpression expr2)
Returns the innermost query between a pair of SqlExpressions. |
BooleanExpression |
ior(SqlExpression expr)
Returns a new expression representing "this || expr". |
BooleanExpression |
lt(SqlExpression expr)
Returns a new expression representing "this < expr". |
BooleanExpression |
lteq(SqlExpression expr)
Returns a new expression representing "this <= expr". |
SqlExpression |
mod(SqlExpression expr)
Returns a new expression representing "this % expr". |
SqlExpression |
mul(SqlExpression expr)
Returns a new expression representing "this * expr". |
SqlExpression |
neg()
Returns a new expression representing "-this". |
static AbstractSqlExpression.Body |
newBody(MonadicOperator op,
SqlExpression operand)
Constructs an expression body consisting of a single SQL operator applied to an expression. |
static AbstractSqlExpression.Body |
newBody(QueryStatement.QueryColumn qsc)
Constructs an expression body consisting of a single column reference. |
static AbstractSqlExpression.Body |
newBody(QueryStatement qs,
java.lang.Class javaType)
Constructs an empty expression body. |
static AbstractSqlExpression.Body |
newBody(SqlExpression subexpr)
Constructs an expression body consisting of a single embedded subexpression. |
static AbstractSqlExpression.Body |
newBody(SqlExpression operand1,
DyadicOperator op,
SqlExpression operand2)
Constructs an expression body consisting of a SQL operator applied to a pair of expressions. |
static AbstractSqlExpression.Body |
newBody(SqlFunction function,
java.util.List args)
Constructs an expression body consisting of an SQL function call. |
ResultExpression |
newResultExpression(PersistenceManager pm)
SELECTs this expression in the surrounding query statement and returns a corresponding result expression. |
static AbstractSqlExpression.Body |
newSubqueryBody(QueryStatement subquery,
java.lang.Class javaType)
Constructs an expression body consisting of a parenthesized subquery. |
BooleanExpression |
not()
Returns a new expression representing "!this". |
BooleanExpression |
noteq(SqlExpression expr)
Returns a new expression representing "this != expr". |
int |
select()
Adds this expression to the list of those SELECTed in its surrounding query statement. |
SqlExpression |
setMapping(Mapping mapping)
Sets the preferred mapping for mapping this expression to/from Java objects. |
SqlExpression |
sub(SqlExpression expr)
Returns a new expression representing "this - expr". |
StatementText |
toStatementText()
Returns the SQL statement text which this object generates. |
java.lang.String |
toString()
Returns the SQL statement text which this object generates as a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final AbstractSqlExpression.Body body
protected final QueryStatement qs
Method Detail |
public QueryStatement getQueryStatement()
SqlExpression
getQueryStatement
in interface SqlExpression
public java.lang.Class getJavaType()
SqlExpression
getJavaType
in interface SqlExpression
public final Mapping getMapping()
SqlExpression
getMapping
in interface SqlExpression
public final ColumnMapping getColumnMapping()
SqlExpression
getColumnMapping
in interface SqlExpression
public SqlExpression setMapping(Mapping mapping)
SqlExpression
setMapping
in interface SqlExpression
public int select()
SqlExpression
select
in interface SqlExpression
public ResultExpression newResultExpression(PersistenceManager pm)
SqlExpression
newResultExpression
in interface SqlExpression
pm
- The persistence manager for the result objects.public java.util.Set getReferencedColumns()
SqlExpression
getReferencedColumns
in interface SqlExpression
QueryStatement.QueryColumn
objects.public BooleanExpression and(SqlExpression expr)
SqlExpression
and
in interface SqlExpression
expr
- The right-hand side of the operator.public BooleanExpression eor(SqlExpression expr)
SqlExpression
eor
in interface SqlExpression
expr
- The right-hand side of the operator.public BooleanExpression ior(SqlExpression expr)
SqlExpression
ior
in interface SqlExpression
expr
- The right-hand side of the operator.public BooleanExpression not()
SqlExpression
not
in interface SqlExpression
public BooleanExpression eq(SqlExpression expr)
SqlExpression
eq
in interface SqlExpression
expr
- The right-hand side of the operator.public BooleanExpression noteq(SqlExpression expr)
SqlExpression
noteq
in interface SqlExpression
expr
- The right-hand side of the operator.public BooleanExpression lt(SqlExpression expr)
SqlExpression
lt
in interface SqlExpression
expr
- The right-hand side of the operator.public BooleanExpression lteq(SqlExpression expr)
SqlExpression
lteq
in interface SqlExpression
expr
- The right-hand side of the operator.public BooleanExpression gt(SqlExpression expr)
SqlExpression
gt
in interface SqlExpression
expr
- The right-hand side of the operator.public BooleanExpression gteq(SqlExpression expr)
SqlExpression
gteq
in interface SqlExpression
expr
- The right-hand side of the operator.public SqlExpression add(SqlExpression expr)
SqlExpression
add
in interface SqlExpression
expr
- The right-hand side of the operator.public SqlExpression sub(SqlExpression expr)
SqlExpression
sub
in interface SqlExpression
expr
- The right-hand side of the operator.public SqlExpression mul(SqlExpression expr)
SqlExpression
mul
in interface SqlExpression
expr
- The right-hand side of the operator.public SqlExpression div(SqlExpression expr)
SqlExpression
div
in interface SqlExpression
expr
- The right-hand side of the operator.public SqlExpression mod(SqlExpression expr)
SqlExpression
mod
in interface SqlExpression
expr
- The right-hand side of the operator.public SqlExpression neg()
SqlExpression
neg
in interface SqlExpression
public SqlExpression com()
SqlExpression
com
in interface SqlExpression
public SqlExpression cast(java.lang.Class type)
SqlExpression
cast
in interface SqlExpression
type
- The Java type to which the expression should be cast.public SqlExpression accessField(java.lang.String fieldName)
SqlExpression
accessField
in interface SqlExpression
fieldName
- The name of the field to be accessed.public SqlExpression callMethod(java.lang.String methodName, java.util.List arguments)
SqlExpression
JDO query methods are implemented via a reflective call to Java methods on the SqlExpression object. Any Java method named as "abcMethod" can be called from a query filter as "abc". The Java method is passed zero or more SqlExpression objects as arguments.
For example, a query method call such as "str.substring(0, 4)" will look to reflectively invoke a Java method on this object having the signature substringMethod(SqlExpression,SqlExpression).
callMethod
in interface SqlExpression
methodName
- The name of the method to be invoked.arguments
- A list of SqlExpression objects representing the arguments to the
method.public StatementText toStatementText()
StatementTextGenerator
toStatementText
in interface StatementTextGenerator
public java.lang.String toString()
StatementTextGenerator
toString
in interface StatementTextGenerator
public static AbstractSqlExpression.Body newBody(QueryStatement qs, java.lang.Class javaType)
public static AbstractSqlExpression.Body newBody(QueryStatement.QueryColumn qsc)
public static AbstractSqlExpression.Body newBody(SqlExpression subexpr)
public static AbstractSqlExpression.Body newSubqueryBody(QueryStatement subquery, java.lang.Class javaType)
public static AbstractSqlExpression.Body newBody(SqlFunction function, java.util.List args)
public static AbstractSqlExpression.Body newBody(MonadicOperator op, SqlExpression operand)
public static AbstractSqlExpression.Body newBody(SqlExpression operand1, DyadicOperator op, SqlExpression operand2)
public static QueryStatement innermostQuery(SqlExpression expr1, SqlExpression expr2)
expr1
- a SQL expressionexpr2
- a SQL expressionpublic static QueryStatement innermostQuery(java.util.Collection c)
c
- A Collection of SqlExpression objects. Cannot be empty.
java.util.NoSuchElementException
- if the collection is empty
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |