| java.lang.Object com.versant.core.jdbc.sql.exp.SqlExp com.versant.core.jdbc.sql.exp.LeafExp com.versant.core.jdbc.sql.exp.SelectExp
All known Subclasses: com.versant.core.jdbc.sql.exp.NotExistsExp, com.versant.core.jdbc.sql.exp.ExistsSelectExp,
SelectExp | public class SelectExp extends LeafExp (Code) | | A 'select ... from ... where ... order by ...' expression.
|
Method Summary | |
public void | addJoin(Join join) Add a Join to end of the joinList. | public Join | addJoin(JdbcColumn[] leftCols, JdbcColumn[] rightCols, SelectExp right) Add a join to the end of the join list. | public void | addJoinMerge(Join aJoin) Add a Join to end of the joinList. | public SqlExp | addOrderBy(OrderNode[] orders, boolean append) Add an order-by expression this to this select. | public SqlExp | addOrderBy(OrderNode[] orders, boolean append, JDOQLNodeToSqlExp visitor) Add an order-by expression this to this select. | public void | appendOrderByExp(SqlExp orderExp) Append the orderExp at the end of the current orderExp. | public void | appendOrderByForColumns(JdbcColumn[] columns) Append the columns at the end of the orderByList as ascending. | public void | appendOrderByForColumns(JdbcColumn column) Append the column at the end of the orderByList as ascending. | public void | appendOrderByForColumns(JdbcColumn[] columns, SelectExp se) | public void | appendSQLImp(SqlDriver driver, CharBuf s, SqlExp leftSibling) Append SQL for this node to s. | public void | appendToSubSelectJoinExp(SqlExp e) Append e to the subSelectJoinExp clause of this select. | public void | appendToWhereExp(SqlExp e) Append e to the where clause of this select. | public boolean | containsOrderExp(JdbcColumn jdbcColumn) | public int | createAlias(int index) Create an aliases for any tables we may have if we do not already have
an alias. | public ColumnExp[] | createColumnExpForOrdering(ClassMetaData target, SelectExp root) | public SqlExp | createInstance() | public SqlExp | createJoinExp(JdbcColumn[] leftCols, JdbcColumn[] rightCols, SelectExp right) Create an expression to join us to right. | public static SelectExp | createJoinToSuperTable(SelectExp root, JdbcField jdbcField) Used to obtain a selectexp for a field. | public static SelectExp | createJoinToSuperTable(SelectExp root, SelectExp joinFromExp, JdbcColumn[] lJoinColumns, JdbcField jdbcField) Used to obtain a selectexp for a field. | public static SelectExp | createJoinToSuperTable(SelectExp root, JdbcTable table) Used to obtain a selectexp for a field. | public void | dump(String indent) Dump debugging info to System.out. | public static void | dumpJoinList(SelectExp joinFromExp, String val) | public static void | dumpJoinListRec(SelectExp joinFromExp, String indent) | public Join | findJoin(JdbcField jdbcField) Search our join list for a join for the field. | public Join | findJoin(JdbcTable table, JdbcField jdbcField) Find a join by table and refField. | public Join | findJoin(SelectExp se) Search our join list for a join to the expression. | public Join | findJoinRec(JdbcField jdbcField) Recursively search our join list for a join for the field. | public SelectExp | findTable(JdbcTable t) If our table is t then return this. | public SelectExp | findTableRecursive(JdbcTable t, JdbcField field) | public SelectExp | findTableRecursive(JdbcTable t) | protected void | finishSelectList(CharBuf s, int start) Check that the select list is valid. | public SqlExp | getClone(SqlExp clone, Map cloneMap) | public Join | getLastJoin() | public SqlExp | getOuterJoinMatchedExp() Get an expression that is true if this join produces a fully
populated row (i.e. | public SqlExp | getOuterJoinNotMatchedExp() Get an expression that is true if this join does not produce a fully
populated row (i.e. | public int | getSelectListColumnCount() Count the number of columns in the select list and all joined to lists. | public boolean | isJoinToManyTable() Does this select contain a join to a many table that may produce
multiple rows? This is used to decide on setting the distinct flag
if this select is converterd into an outer join. | public static void | mergeJoinList(Join j) | public SqlExp | normalize(SqlDriver driver, SelectExp sel, boolean convertExists) Normalize this node i.e. | public void | prependOrderByForColumns(JdbcColumn[] columns) Insert the columns at the start of the orderByList as ascending. | public void | replaceSelectExpRef(SelectExp old, SelectExp nw) Replace any references to old with nw. | public void | setOuterRec() Set our outer flag and follow all our joins and make then outer as
well. | public String | toString() |
EMPTY_COLUMS_STRUCT | final public static ColumnStruct[] EMPTY_COLUMS_STRUCT(Code) | | |
alias | public String alias(Code) | | The alias assigned to our table (null if none).
|
distinct | public boolean distinct(Code) | | Is this a 'select distinct'?
|
forUpdate | public boolean forUpdate(Code) | | Is this a 'select for update'?
|
jdbcField | public JdbcField jdbcField(Code) | | The field that was navigated to get to this table (null if none).
|
joinList | public Join joinList(Code) | | Linked list of joins (null if none). Note that the selectExp for
each entry in the list may have its own joinList and so on
recusively (i.e. this is actually a tree).
|
orderByEndIndex | public int orderByEndIndex(Code) | | Index of the end of the "order by ..." clause + 1 as of the last call to
appendSQL.
|
orderByList | public SqlExp orderByList(Code) | | Linked list of expressions to order by (null if none).
|
orderByStartIndex | public int orderByStartIndex(Code) | | Index of the start of the "order by ..." clause as of the last call to
appendSQL.
|
outer | public boolean outer(Code) | | Is table involved in an outer join as the outer table?
|
selectList | public SqlExp selectList(Code) | | Linked list of expressions to select (null if none).
|
selectListCountBeforeAggregate | public int selectListCountBeforeAggregate(Code) | | |
selectListEndIndex | public int selectListEndIndex(Code) | | Index of the last column in the select list + 1 as of the last call
to appendSQL.
|
selectListFirstColEndIndex | public int selectListFirstColEndIndex(Code) | | Index of the last charcter of the first column in the select list + 1
as of the last call to appendSQL.
|
selectListStartIndex | public int selectListStartIndex(Code) | | Index of the first column in the select list as of the last call to
appendSQL.
|
subSelectJoinExp | public SqlExp subSelectJoinExp(Code) | | The 'join' expression for a sub select (null if none). This will end
up in the where clause but is kept separately so nested sub selects can
be converted into joins easily.
|
var | public VarNode var(Code) | | The variable this expression belongs to (null if none).
|
whereExp | public SqlExp whereExp(Code) | | The where clause expression (null if none).
|
SelectExp | public SelectExp()(Code) | | |
addJoin | public void addJoin(Join join)(Code) | | Add a Join to end of the joinList.
|
addJoinMerge | public void addJoinMerge(Join aJoin)(Code) | | Add a Join to end of the joinList. This is an attempt to not add uncess.
joins.
|
addOrderBy | public SqlExp addOrderBy(OrderNode[] orders, boolean append)(Code) | | Add an order-by expression this to this select.
|
appendOrderByExp | public void appendOrderByExp(SqlExp orderExp)(Code) | | Append the orderExp at the end of the current orderExp.
|
appendOrderByForColumns | public void appendOrderByForColumns(JdbcColumn[] columns)(Code) | | Append the columns at the end of the orderByList as ascending.
|
appendOrderByForColumns | public void appendOrderByForColumns(JdbcColumn column)(Code) | | Append the column at the end of the orderByList as ascending.
|
appendOrderByForColumns | public void appendOrderByForColumns(JdbcColumn[] columns, SelectExp se)(Code) | | Append the columns to the orderByList
|
appendSQLImp | public void appendSQLImp(SqlDriver driver, CharBuf s, SqlExp leftSibling)(Code) | | Append SQL for this node to s.
Parameters: driver - The driver being used Parameters: s - Append the SQL here Parameters: leftSibling - |
appendToSubSelectJoinExp | public void appendToSubSelectJoinExp(SqlExp e)(Code) | | Append e to the subSelectJoinExp clause of this select. This will
create a new AndExp if needed.
|
appendToWhereExp | public void appendToWhereExp(SqlExp e)(Code) | | Append e to the where clause of this select. This will create a new
AndExp if needed.
|
createAlias | public int createAlias(int index)(Code) | | Create an aliases for any tables we may have if we do not already have
an alias.
|
createJoinToSuperTable | public static SelectExp createJoinToSuperTable(SelectExp root, JdbcField jdbcField)(Code) | | Used to obtain a selectexp for a field. This will add a join to the supertable
if not already added.
|
createJoinToSuperTable | public static SelectExp createJoinToSuperTable(SelectExp root, SelectExp joinFromExp, JdbcColumn[] lJoinColumns, JdbcField jdbcField)(Code) | | Used to obtain a selectexp for a field. This will add a join to the supertable
if not already added.
|
createJoinToSuperTable | public static SelectExp createJoinToSuperTable(SelectExp root, JdbcTable table)(Code) | | Used to obtain a selectexp for a field. This will add a join to the supertable
if not already added.
|
dump | public void dump(String indent)(Code) | | Dump debugging info to System.out.
|
findJoin | public Join findJoin(SelectExp se)(Code) | | Search our join list for a join to the expression. This is not recursive
i.e. it only finds joins in our join list. Returns null if not found.
|
findTable | public SelectExp findTable(JdbcTable t)(Code) | | If our table is t then return this. Otherwise search our join list
for a join for the table. This is not recursive i.e. it only finds
tables in our join list. Returns null if not found.
|
finishSelectList | protected void finishSelectList(CharBuf s, int start)(Code) | | Check that the select list is valid.
|
getOuterJoinMatchedExp | public SqlExp getOuterJoinMatchedExp()(Code) | | Get an expression that is true if this join produces a fully
populated row (i.e. all of the outer most pk columns are not null
indicating that all outer joins were matched).
|
getOuterJoinNotMatchedExp | public SqlExp getOuterJoinNotMatchedExp()(Code) | | Get an expression that is true if this join does not produce a fully
populated row (i.e. one or more of the outer most pk columns are null
indicating that an outer join was not matched).
|
getSelectListColumnCount | public int getSelectListColumnCount()(Code) | | Count the number of columns in the select list and all joined to lists.
|
isJoinToManyTable | public boolean isJoinToManyTable()(Code) | | Does this select contain a join to a many table that may produce
multiple rows? This is used to decide on setting the distinct flag
if this select is converterd into an outer join.
|
mergeJoinList | public static void mergeJoinList(Join j)(Code) | | |
normalize | public SqlExp normalize(SqlDriver driver, SelectExp sel, boolean convertExists)(Code) | | Normalize this node i.e. transform it into its simplist possible form.
This will turn sub selects into joins and so on.
|
prependOrderByForColumns | public void prependOrderByForColumns(JdbcColumn[] columns)(Code) | | Insert the columns at the start of the orderByList as ascending.
|
replaceSelectExpRef | public void replaceSelectExpRef(SelectExp old, SelectExp nw)(Code) | | Replace any references to old with nw. This is used when redundant
joins are removed.
|
setOuterRec | public void setOuterRec()(Code) | | Set our outer flag and follow all our joins and make then outer as
well.
|
Methods inherited from com.versant.core.jdbc.sql.exp.SqlExp | public void append(SqlExp extra)(Code)(Java Doc) final public void appendSQL(SqlDriver driver, CharBuf s, SqlExp leftSibling)(Code)(Java Doc) protected void appendSQLImp(SqlDriver driver, CharBuf s, SqlExp leftSibling)(Code)(Java Doc) public static SqlExp appendWithAnd(SqlExp base, SqlExp e)(Code)(Java Doc) public int createAlias(int index)(Code)(Java Doc) public static SqlExp createBinaryOpExp(SqlExp left, int op, SqlExp right)(Code)(Java Doc) public static SqlExp createClone(SqlExp sqlExp)(Code)(Java Doc) public static SqlExp createClone(SqlExp inst, Map cloneMap)(Code)(Java Doc) public SqlExp createInstance()(Code)(Java Doc) public void dump(String indent)(Code)(Java Doc) public void dumpList(String indent)(Code)(Java Doc) public int getClassIndex()(Code)(Java Doc) public SqlExp getClone(SqlExp clone, Map cloneMap)(Code)(Java Doc) public int getConvertToJoin()(Code)(Java Doc) public int getFirstCharIndex()(Code)(Java Doc) public int getJavaTypeCode()(Code)(Java Doc) public int getJdbcType()(Code)(Java Doc) final public int getLastCharIndex()(Code)(Java Doc) final public int getPreFirstCharIndex()(Code)(Java Doc) public SelectExp getSingleSelectExp(SelectExp exclude)(Code)(Java Doc) public boolean isNegative()(Code)(Java Doc) public SqlExp normalize(SqlDriver driver, SelectExp sel, boolean convertExists)(Code)(Java Doc) public void replaceSelectExpRef(SelectExp old, SelectExp nw)(Code)(Java Doc) public boolean requiresParensInAnd()(Code)(Java Doc) public boolean requiresParensInMultiply()(Code)(Java Doc) public void setOuter(boolean on)(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|