@Module public abstract class Expr extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FALSE |
protected static L10N |
L |
static int |
TRUE |
static int |
UNKNOWN |
Constructor and Description |
---|
Expr() |
Modifier and Type | Method and Description |
---|---|
Expr |
bind(Query query) |
long |
cost(java.util.ArrayList<FromItem> fromList)
Returns the cost based on the given FromList.
|
com.caucho.db.sql.Order |
createOrder(int index)
Returns the order.
|
int |
evalBoolean(QueryContext context)
Evaluates the expression as a boolean.
|
byte[] |
evalBytes(QueryContext context)
Evaluates the expression as a stream.
|
long |
evalDate(QueryContext context)
Evaluates the expression as a date.
|
double |
evalDouble(QueryContext context)
Evaluates the expression as a double.
|
boolean |
evalEqual(QueryContext context,
byte[] data) |
boolean |
evalEqual(QueryContext context,
java.lang.String evalString) |
void |
evalGroup(QueryContext context)
Evaluates aggregate functions during the group phase.
|
long |
evalLong(QueryContext context)
Evaluates the expression as a long.
|
java.io.InputStream |
evalStream(QueryContext context)
Evaluates the expression as a stream.
|
java.lang.String |
evalString(QueryContext context)
Evaluates the expression as a string.
|
int |
evalToBuffer(QueryContext context,
byte[] buffer,
int offset)
Evaluates the expression to a buffer
|
int |
evalToBuffer(QueryContext context,
byte[] buffer,
int off,
Column.ColumnType columnType)
Evaluates the expression to a buffer
|
void |
evalToResult(QueryContext context,
SelectResult result)
Evaluates the expression, writing to the result stream.
|
com.caucho.db.sql.RowIterateExpr |
getIndexExpr(FromItem fromItem)
Returns an index expression if available.
|
java.lang.String |
getName()
Returns any column name.
|
int |
getSQLType() |
Table |
getTable()
Returns the table.
|
java.lang.Class<?> |
getType()
Returns the expected result type of the expression.
|
Column.ColumnType |
getTypeCode()
Returns the java type code if known.
|
long |
indexCost(java.util.ArrayList<FromItem> costItems)
Returns the cost bonus for an index.
|
long |
indexSubCost(java.util.ArrayList<FromItem> costItems)
Returns the cost bonus for an index.
|
void |
initGroup(QueryContext context)
Initializes aggregate functions during the group phase.
|
boolean |
isBinaryStream(QueryContext context)
Returns true if the expression returns a binary stream.
|
boolean |
isBoolean()
Returns true if the expression returns a boolean.
|
boolean |
isDouble()
Returns true if the expression returns a double.
|
boolean |
isLong()
Returns true if the expression returns a long.
|
boolean |
isNull(QueryContext context)
Returns true if result is null
|
boolean |
isNullable()
Returns true if the expression can return a null value.
|
boolean |
isParam()
Returns true for a parameter expression.
|
boolean |
isSelect(QueryContext context)
Returns true if the expression selects the row.
|
void |
splitAnd(java.util.ArrayList<Expr> andProduct)
Splits the expr into and blocks.
|
long |
subCost(java.util.ArrayList<FromItem> fromList)
Returns the cost based on the given FromList.
|
void |
updateDouble(QueryContext context,
double value)
Updates the expression as a double
|
void |
updateLong(QueryContext context,
long value)
Updates the expression as a long
|
void |
updateString(QueryContext context,
java.lang.String value)
Updates the expression as a string
|
protected static final L10N L
public static final int UNKNOWN
public static final int FALSE
public static final int TRUE
public java.lang.Class<?> getType()
public Column.ColumnType getTypeCode()
public int getSQLType()
public boolean isLong()
public boolean isDouble()
public boolean isBoolean()
public boolean isBinaryStream(QueryContext context)
public boolean isParam()
public boolean isNullable()
public java.lang.String getName()
public Table getTable()
public void splitAnd(java.util.ArrayList<Expr> andProduct)
public long cost(java.util.ArrayList<FromItem> fromList)
public long subCost(java.util.ArrayList<FromItem> fromList)
public long indexCost(java.util.ArrayList<FromItem> costItems)
public long indexSubCost(java.util.ArrayList<FromItem> costItems)
public com.caucho.db.sql.RowIterateExpr getIndexExpr(FromItem fromItem)
public com.caucho.db.sql.Order createOrder(int index)
public boolean isNull(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public boolean isSelect(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public int evalBoolean(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public java.lang.String evalString(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public void updateString(QueryContext context, java.lang.String value) throws java.sql.SQLException
java.sql.SQLException
public long evalLong(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public void updateLong(QueryContext context, long value) throws java.sql.SQLException
java.sql.SQLException
public double evalDouble(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public void updateDouble(QueryContext context, double value) throws java.sql.SQLException
java.sql.SQLException
public long evalDate(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public void evalToResult(QueryContext context, SelectResult result) throws java.sql.SQLException
result
- the output resultjava.sql.SQLException
public java.io.InputStream evalStream(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public byte[] evalBytes(QueryContext context) throws java.sql.SQLException
rows
- the current database tuplejava.sql.SQLException
public int evalToBuffer(QueryContext context, byte[] buffer, int offset) throws java.sql.SQLException
result
- the result bufferjava.sql.SQLException
public int evalToBuffer(QueryContext context, byte[] buffer, int off, Column.ColumnType columnType) throws java.sql.SQLException
result
- the result bufferjava.sql.SQLException
public void initGroup(QueryContext context) throws java.sql.SQLException
context
- the current database tuplejava.sql.SQLException
public void evalGroup(QueryContext context) throws java.sql.SQLException
context
- the current database tuplejava.sql.SQLException
public boolean evalEqual(QueryContext context, java.lang.String evalString) throws java.sql.SQLException
java.sql.SQLException
public boolean evalEqual(QueryContext context, byte[] data) throws java.sql.SQLException
java.sql.SQLException