com.caucho.amber.expr
Interface AmberExpr

All Known Subinterfaces:
EntityPathExpr, IdFieldExpr, PathExpr
All Known Implementing Classes:
AbsFunExpr, AbstractAmberExpr, AbstractPathExpr, AllExpr, AndExpr, AnyExpr, ArgExpr, BetweenExpr, BinaryExpr, BooleanColumnExpr, CollectionIdExpr, ColumnExpr, ConcatFunExpr, CurrentDateFunExpr, CurrentTimeFunExpr, CurrentTimestampFunExpr, DateTimeFunExpr, DependentEntityOneToOneExpr, ElementCollectionExpr, ElementCollectionIdExpr, EmbeddedExpr, EmptyExpr, EnumExpr, EqualJoinExpr, ExistsExpr, FunExpr, IdExpr, InExpr, JoinExpr, KeyColumnExpr, KeyManyToOneExpr, KeyPropertyExpr, LengthFunExpr, LikeExpr, LiteralExpr, LoadBasicExpr, LoadEmbeddedExpr, LoadEntityExpr, LoadExpr, LocateFunExpr, LowerFunExpr, ManyToOneExpr, ManyToOneJoinExpr, MapFieldExpr, MapManyToManyExpr, MaxFunExpr, MemberExpr, MinFunExpr, ModFunExpr, NullExpr, OneToManyExpr, OneToManyJoinExpr, OrExpr, SizeFunExpr, SqrtFunExpr, SubSelectExpr, SubstringFunExpr, SumFunExpr, TrimFunExpr, UnaryExpr, UpperFunExpr

public interface AmberExpr

Represents an Amber query expression


Field Summary
static int IS_INNER_JOIN
           
static int USES_DATA
           
 
Method Summary
 AmberExpr bindSelect(QueryParser parser)
          Binds the expression as a select item.
 AmberExpr createBoolean()
          Converts to a boolean expression.
 boolean exists()
          Returns true if the expression item is required to exist, e.g.
 boolean exists(FromItem from)
          Returns true if the item is required to exist by the expression, e.g.
 EntityItem findItem(AmberConnection aConn, java.sql.ResultSet rs, int index)
          Returns the object for the expr.
 void generateHaving(CharBuffer cb)
          Generates the having expression.
 void generateJoin(CharBuffer cb)
          Generates the where expression.
 void generateSelect(CharBuffer cb)
          Generates the select expression.
 void generateUpdateWhere(CharBuffer cb)
          Generates the (update) where expression.
 void generateWhere(CharBuffer cb)
          Generates the where expression.
 java.lang.Object getCacheObject(AmberConnection aConn, java.sql.ResultSet rs, int index)
          Returns the cache object for the expr.
 java.lang.Object getObject(AmberConnection aConn, java.sql.ResultSet rs, int index)
          Returns the object for the expr.
 AmberType getType()
          Returns the expr type.
 boolean hasRelationship()
          Returns true if this expr has any relationship.
 boolean isBoolean()
          Returns true for a boolean expression.
 AmberExpr replaceJoin(JoinExpr join)
          Returns true if the expression uses the from item.
 void setInternalArgType(AmberExpr otherExpr)
          Binds the argument type based on another expr.
 boolean usesFrom(FromItem from, int type)
          Returns true if the expression uses the from item.
 boolean usesFrom(FromItem from, int type, boolean isNot)
          Returns true if the expression uses the from item.
 

Field Detail

USES_DATA

static final int USES_DATA
See Also:
Constant Field Values

IS_INNER_JOIN

static final int IS_INNER_JOIN
See Also:
Constant Field Values
Method Detail

isBoolean

boolean isBoolean()
Returns true for a boolean expression.


getType

AmberType getType()
Returns the expr type.


bindSelect

AmberExpr bindSelect(QueryParser parser)
Binds the expression as a select item.


usesFrom

boolean usesFrom(FromItem from,
                 int type)
Returns true if the expression uses the from item.


usesFrom

boolean usesFrom(FromItem from,
                 int type,
                 boolean isNot)
Returns true if the expression uses the from item.


exists

boolean exists(FromItem from)
Returns true if the item is required to exist by the expression, e.g. foo.id='1' forces foo to exist.


exists

boolean exists()
Returns true if the expression item is required to exist, e.g. constants and arguments. (Can also apply to arguments required to exist after a particular from item, i.e. from items already proved to exist.)


replaceJoin

AmberExpr replaceJoin(JoinExpr join)
Returns true if the expression uses the from item.


generateWhere

void generateWhere(CharBuffer cb)
Generates the where expression.


generateUpdateWhere

void generateUpdateWhere(CharBuffer cb)
Generates the (update) where expression.


generateHaving

void generateHaving(CharBuffer cb)
Generates the having expression.


generateJoin

void generateJoin(CharBuffer cb)
Generates the where expression.


generateSelect

void generateSelect(CharBuffer cb)
Generates the select expression.


createBoolean

AmberExpr createBoolean()
                        throws QueryParseException
Converts to a boolean expression.

Throws:
QueryParseException

getObject

java.lang.Object getObject(AmberConnection aConn,
                           java.sql.ResultSet rs,
                           int index)
                           throws java.sql.SQLException
Returns the object for the expr.

Throws:
java.sql.SQLException

getCacheObject

java.lang.Object getCacheObject(AmberConnection aConn,
                                java.sql.ResultSet rs,
                                int index)
                                throws java.sql.SQLException
Returns the cache object for the expr.

Throws:
java.sql.SQLException

hasRelationship

boolean hasRelationship()
Returns true if this expr has any relationship.


findItem

EntityItem findItem(AmberConnection aConn,
                    java.sql.ResultSet rs,
                    int index)
                    throws java.sql.SQLException
Returns the object for the expr.

Throws:
java.sql.SQLException

setInternalArgType

void setInternalArgType(AmberExpr otherExpr)
Binds the argument type based on another expr.