com.triactive.jdo.store.sql.expr
Interface AbstractSqlExpression.Body

All Superinterfaces:
StatementTextGenerator
All Known Subinterfaces:
AbstractSqlExpression.CompoundExpression, AbstractSqlExpression.SimpleColumnReference, AbstractSqlExpression.SubqueryExpression
Enclosing interface:
AbstractSqlExpression

public static interface AbstractSqlExpression.Body
extends StatementTextGenerator

The "body" of an SQL expression. An AbstractSqlExpression consists of exactly one body object, but the expression is distinct from its body.

Different SqlExpression classes encapsulate what kind of operations can be applied to an expression to yield new expressions.

On the other hand, different Body classes mainly implement the different ways in which the text of an expression can be constructed. For example, it may be constructed as a simple reference to a column, as an operator applied to another expression, as a function applied to a list of argument expressions, etc.

Author:
Mike Martin

Method Summary
 java.lang.Class getJavaType()
          Returns the corresponding Java type of the expression.
 Mapping getMapping()
          Returns the preferred mapping for mapping this expression to/from Java objects.
 QueryStatement getQueryStatement()
          Returns the query statement to which the expression belongs.
 Operator lowestOperator()
          Returns the operator in the expression with the lowest precedence.
 
Methods inherited from interface com.triactive.jdo.store.sql.expr.StatementTextGenerator
toStatementText, toString
 

Method Detail

getQueryStatement

public QueryStatement getQueryStatement()
Returns the query statement to which the expression belongs.

Does not need to be especially efficient since AbstractSqlExpression will call it no more than once.


getJavaType

public java.lang.Class getJavaType()
Returns the corresponding Java type of the expression. This is the type that would (should) be produced if loading a result value of the expression into a Java object.

Does not need to be especially efficient since AbstractSqlExpression will call it no more than once.

Returns:
the Java type of the expression

getMapping

public Mapping getMapping()
Returns the preferred mapping for mapping this expression to/from Java objects.

Does not need to be especially efficient since AbstractSqlExpression will call it no more than once.

Returns:
the preferred mapping for the expression, or null if there is none

lowestOperator

public Operator lowestOperator()
Returns the operator in the expression with the lowest precedence.

Returns:
the lowest precedence operator in the expression, or null if the expression uses no operators.


Copyright 2001-2007 The TJDO Project All Rights Reserved.