org.axiondb.engine.commands

Class AxionQueryContext

public class AxionQueryContext extends Object

AxionQueryContext holds metadata for the Query or Sub-Query.

Version: $Revision: 1.13 $ $Date: 2005/12/20 18:32:28 $

Author: Ahimanikya Satapathy

Constructor Summary
AxionQueryContext()
Method Summary
voidaddAllSelectToResolvedSelect()
voidaddFrom(TableIdentifier table)
Adds a TableIdentifierto the list of tables being selected from.
voidaddOrderBy(OrderNode orderby)
Appends an OrderNodeto the order by clause for this query
voidaddSelect(Selectable column)
Adds a Selectableto the list of items being selected.
ListcreateLiteralList()
booleanfoundAggregateFunction()
StringgetAliasName()
booleangetDistinct()
Indicates if the java.sql.ResultSetgenerated from this object will contain distinct tuples.
FromNodegetFrom()
Gets the root FromNodefor the select statement.
TableIdentifiergetFrom(int i)
Gets the i th table being selected.
TableIdentifier[]getFromArray()
intgetFromCount()
Gets the number of tables being from.
ListgetGroupBy()
Gets Selectable in Group by clause.
SelectablegetGroupBy(int i)
Gets Selectable in Group by clause.
intgetGroupByCount()
Gets the number of Slectables group by in my query.
SelectablegetHaving()
LiteralgetLimit()
LiteralgetOffset()
ListgetOrderBy()
Gets the List of OrderNodein my order by clause.
OrderNodegetOrderBy(int i)
Gets the i th OrderNodein my order by clause.
intgetOrderByCount()
Gets the number of OrderNodes in my query.
RowDecoratorgetParentRow()
TableIdentifier[]getParentTables()
ListgetResolvedSelect()
RowIteratorgetRows()
ListgetSelect()
SelectablegetSelect(int i)
Gets the i th Selectablebeing selected.
intgetSelectCount()
Gets the number of Selectables being selected.
Selectable[]getSelected()
intgetTableCount()
TableIdentifier[]getTables()
TableIdentifiergetTables(int i)
SelectablegetWhere()
Returns the where treefor this query.
booleanisCorrelatedSubQuery()
booleanisExplain()
booleanisResolved()
booleanisTablePartOfSelect(TableIdentifier tid)
voidsetAliasName(String name)
voidsetCorrelatedSubQuery(boolean isCorrelatedSubQuery)
voidsetDistinct(boolean distinct)
Determines if the java.sql.ResultSetgenerated from this object will contain distinct tuples (default is false).
voidsetExplain(boolean explain)
voidsetFoundAggregateFunction(boolean found)
voidsetFrom(FromNode from)
Sets the root FromNodefor the select statement.
voidsetGroupBy(List groupby)
Sets the group by clause for this query.
voidsetHaving(Selectable having)
voidsetLimit(Literal limit)
voidsetOffset(Literal offset)
voidsetOrderBy(List orderby)
Sets the order by clause for this query.
voidsetParentRow(RowDecorator row)
voidsetParentTables(TableIdentifier[] tables)
voidsetResolved(boolean resolved)
voidsetResolvedSelect(List select)
voidsetRows(RowIterator rows)
voidsetSelect(int i, Selectable sel)
Sets the i th Selectablebeing selected.
voidsetSelect(List columns)
voidsetSelected(Selectable[] selected)
voidsetTables(TableIdentifier[] tables)
voidsetWhere(Selectable where)
Sets the where treefor this query.
StringtoString()

Constructor Detail

AxionQueryContext

public AxionQueryContext()

Method Detail

addAllSelectToResolvedSelect

public void addAllSelectToResolvedSelect()

addFrom

public void addFrom(TableIdentifier table)
Adds a TableIdentifierto the list of tables being selected from.

Parameters: table a TableIdentifier

Throws: IllegalStateException if I have already been resolved

addOrderBy

public void addOrderBy(OrderNode orderby)
Appends an OrderNodeto the order by clause for this query

Parameters: orderby an OrderNodeto append

Throws: IllegalStateException if I have already been resolved

addSelect

public void addSelect(Selectable column)
Adds a Selectableto the list of items being selected.

Parameters: column the Selectableto add

Throws: IllegalStateException if I have already been resolved

createLiteralList

public List createLiteralList()

foundAggregateFunction

public boolean foundAggregateFunction()

getAliasName

public String getAliasName()

getDistinct

public boolean getDistinct()
Indicates if the java.sql.ResultSetgenerated from this object will contain distinct tuples.

Returns: true for distinct tuples

getFrom

public FromNode getFrom()
Gets the root FromNodefor the select statement.

getFrom

public TableIdentifier getFrom(int i)
Gets the i th table being selected. Clients should treat the returned value as immutable.

Parameters: i the zero-based index

getFromArray

public TableIdentifier[] getFromArray()

getFromCount

public int getFromCount()
Gets the number of tables being from.

getGroupBy

public List getGroupBy()
Gets Selectable in Group by clause.

getGroupBy

public Selectable getGroupBy(int i)
Gets Selectable in Group by clause. Clients should treat the returned value as immutable.

Parameters: i the zero-based index

getGroupByCount

public int getGroupByCount()
Gets the number of Slectables group by in my query.

getHaving

public Selectable getHaving()

getLimit

public Literal getLimit()

getOffset

public Literal getOffset()

getOrderBy

public List getOrderBy()
Gets the List of OrderNodein my order by clause.

getOrderBy

public OrderNode getOrderBy(int i)
Gets the i th OrderNodein my order by clause. Clients should treat the returned value as immutable.

Parameters: i the zero-based index

getOrderByCount

public int getOrderByCount()
Gets the number of OrderNodes in my query.

getParentRow

public RowDecorator getParentRow()

getParentTables

public TableIdentifier[] getParentTables()

getResolvedSelect

public List getResolvedSelect()

getRows

public RowIterator getRows()

getSelect

public List getSelect()

getSelect

public Selectable getSelect(int i)
Gets the i th Selectablebeing selected. Clients should treat the returned value as immutable.

Parameters: i the zero-based index

getSelectCount

public int getSelectCount()
Gets the number of Selectables being selected.

getSelected

public Selectable[] getSelected()

getTableCount

public int getTableCount()

getTables

public TableIdentifier[] getTables()

getTables

public TableIdentifier getTables(int i)

getWhere

public Selectable getWhere()
Returns the where treefor this query. Clients should treat the returned value as immutable.

Returns: the where treefor this query, or null.

isCorrelatedSubQuery

public boolean isCorrelatedSubQuery()

isExplain

public boolean isExplain()

isResolved

public boolean isResolved()

isTablePartOfSelect

public boolean isTablePartOfSelect(TableIdentifier tid)

setAliasName

public void setAliasName(String name)

setCorrelatedSubQuery

public void setCorrelatedSubQuery(boolean isCorrelatedSubQuery)

setDistinct

public void setDistinct(boolean distinct)
Determines if the java.sql.ResultSetgenerated from this object will contain distinct tuples (default is false).

Parameters: distinct true for distinct tuples

setExplain

public void setExplain(boolean explain)

setFoundAggregateFunction

public void setFoundAggregateFunction(boolean found)

setFrom

public void setFrom(FromNode from)
Sets the root FromNodefor the select statement.

setGroupBy

public void setGroupBy(List groupby)
Sets the group by clause for this query.

Parameters: groupby a Listof Selectables.

Throws: IllegalStateException if I have already been resolved

setHaving

public void setHaving(Selectable having)

setLimit

public void setLimit(Literal limit)

setOffset

public void setOffset(Literal offset)

setOrderBy

public void setOrderBy(List orderby)
Sets the order by clause for this query.

Parameters: orderby a Listof OrderNodes.

Throws: IllegalStateException if I have already been resolved

setParentRow

public void setParentRow(RowDecorator row)

setParentTables

public void setParentTables(TableIdentifier[] tables)

setResolved

public void setResolved(boolean resolved)

setResolvedSelect

public void setResolvedSelect(List select)

setRows

public void setRows(RowIterator rows)

setSelect

public void setSelect(int i, Selectable sel)
Sets the i th Selectablebeing selected.

Parameters: i the zero-based index sel the new Selectable

Throws: IllegalStateException if I have already been resolved

setSelect

public void setSelect(List columns)

setSelected

public void setSelected(Selectable[] selected)

setTables

public void setTables(TableIdentifier[] tables)

setWhere

public void setWhere(Selectable where)
Sets the where treefor this query.

Parameters: where a boolean valued Selectable

Throws: IllegalStateException if I have already been resolved

toString

public String toString()