com.caucho.amber.expr.fun
Class FunExpr

java.lang.Object
  extended by com.caucho.amber.expr.AbstractAmberExpr
      extended by com.caucho.amber.expr.fun.FunExpr
All Implemented Interfaces:
AmberExpr
Direct Known Subclasses:
AbsFunExpr, ConcatFunExpr, DateTimeFunExpr, LengthFunExpr, LocateFunExpr, LowerFunExpr, MaxFunExpr, MinFunExpr, ModFunExpr, SizeFunExpr, SqrtFunExpr, SubstringFunExpr, SumFunExpr, TrimFunExpr, UpperFunExpr

public class FunExpr
extends AbstractAmberExpr

Function expression


Field Summary
 
Fields inherited from interface com.caucho.amber.expr.AmberExpr
IS_INNER_JOIN, USES_DATA
 
Constructor Summary
protected FunExpr(QueryParser parser, java.lang.String id, java.util.ArrayList<AmberExpr> args, boolean distinct)
          Creates a new function expression
 
Method Summary
 AmberExpr bindSelect(QueryParser parser)
          Binds the expression as a select item.
static FunExpr create(QueryParser parser, java.lang.String id, java.util.ArrayList<AmberExpr> args, boolean distinct)
           
 void generateHaving(CharBuffer cb)
          Generates the having expression.
 void generateUpdateWhere(CharBuffer cb)
          Generates the (update) where expression.
 void generateWhere(CharBuffer cb)
          Generates the where expression.
 java.util.ArrayList<AmberExpr> getArgs()
          Returns the args.
 java.lang.Object getObject(AmberConnection aConn, java.sql.ResultSet rs, int index)
          Returns the object for the expr.
 AmberType getType()
          Returns the expr type.
 java.lang.String toString()
           
 boolean usesFrom(FromItem from, int type, boolean isNot)
          Returns true if the expression uses the from item.
 
Methods inherited from class com.caucho.amber.expr.AbstractAmberExpr
createBoolean, exists, exists, findItem, generateJoin, generateSelect, getCacheObject, getColumnCount, hasRelationship, isBoolean, replaceJoin, setInternalArgType, usesFrom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FunExpr

protected FunExpr(QueryParser parser,
                  java.lang.String id,
                  java.util.ArrayList<AmberExpr> args,
                  boolean distinct)
Creates a new function expression

Method Detail

create

public static FunExpr create(QueryParser parser,
                             java.lang.String id,
                             java.util.ArrayList<AmberExpr> args,
                             boolean distinct)

bindSelect

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

Specified by:
bindSelect in interface AmberExpr
Specified by:
bindSelect in class AbstractAmberExpr

getType

public AmberType getType()
Returns the expr type.

Specified by:
getType in interface AmberExpr
Overrides:
getType in class AbstractAmberExpr

usesFrom

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

Specified by:
usesFrom in interface AmberExpr
Overrides:
usesFrom in class AbstractAmberExpr

generateWhere

public void generateWhere(CharBuffer cb)
Generates the where expression.

Specified by:
generateWhere in interface AmberExpr
Overrides:
generateWhere in class AbstractAmberExpr

generateUpdateWhere

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

Specified by:
generateUpdateWhere in interface AmberExpr
Overrides:
generateUpdateWhere in class AbstractAmberExpr

generateHaving

public void generateHaving(CharBuffer cb)
Generates the having expression.

Specified by:
generateHaving in interface AmberExpr
Overrides:
generateHaving in class AbstractAmberExpr

getObject

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

Specified by:
getObject in interface AmberExpr
Overrides:
getObject in class AbstractAmberExpr
Throws:
java.sql.SQLException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getArgs

public java.util.ArrayList<AmberExpr> getArgs()
Returns the args.