|
|||||||||||
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.QueryStatement.QueryColumn
Represents a column in one of the table expressions in a query statement. A query column object is essentially the pair [TableExpression,Column], and equates to a SQL fragment such as "T1.COL".
A query column can be created and manipulated without necessarily being
"used" in the actual query statement.
If it is to be used, meaning some SqlExpression
fragment wants to
include a reference to the column, then the reference()
method
must be called to indicate the column is actually being
referenced.
Furthermore, a call to reference() cannot be postponed until the time
that statement text is being generated (i.e.
StatementTextGenerator.toStatementText()
).
It must be knowable in advance (by, for instance, a call to
SqlExpression.getReferencedColumns()
) which columns are being
referenced.
Mainly this is because referencing a column may cause its table
expression to mutate.
To help enforce this in the code an unreferenced query column throws an
exception if its toString() method is called.
Field Summary | |
Column |
col
The column within the table expression. |
TableExpression |
te
The table expression of this query column. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Tests this object for equality with another object. |
QueryStatement |
getQueryStatement()
Returns the query statement to which this query column belongs. |
CorrelationName |
getRangeVariable()
Returns the range variable (table alias) for the column in its query statement. |
int |
hashCode()
Returns a hash code value for this object. |
boolean |
isOuterJoined()
Returns true if the query column belongs to a table expression that was outer-joined at any point. |
void |
reference()
Generates a reference to the query column. |
SqlExpression |
toExpression()
Returns a properly-typed SQL expression representing this query column. |
java.lang.String |
toString()
Returns the string representation of this query column. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public final TableExpression te
public final Column col
Method Detail |
public QueryStatement getQueryStatement()
public SqlExpression toExpression()
public void reference()
public CorrelationName getRangeVariable()
java.lang.IllegalStateException
- If the query column has not been referenced.public boolean isOuterJoined()
true
if the column's table participated in an outer
join at any point.public int hashCode()
public boolean equals(java.lang.Object o)
public java.lang.String toString()
java.lang.IllegalStateException
- If the query column has not been referenced.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |