|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An RdbExpQueryLeaf is a particular type of RdbQueryLeaf for which the associated SQL query if not given as a SQL String, but is computed from an Expression (representing the filter) and from abstract information made of QualifiedTables, representing the FROM part of the SQL query.
The Medor optimizer can "reason" about RdbExpQueryLeaves, and merge several such query leaves into one if they have the same DataStore.
The life cycle of an RdbExpQueryLeaf is:
Method Summary | |
void |
addGroupBy(RdbExpField groupBy)
Adds a groupBy Field. |
void |
addQualifiedTable(QualifiedTable qt)
Adds a QualifiedTable to the QueryLeaf |
RdbExpField |
addRdbField(RdbExpField rdbField)
Adds an RdbExpField to the RdbExpQueryLeaf. |
RdbExpField |
addRdbField(java.lang.String fieldName,
PType type,
java.lang.String colName,
QualifiedTable table)
Adds a Field to the RdbExpQueryLeaf |
boolean |
containsQualifiedTable(QualifiedTable qt)
Checks if a QualifiedTable is in the list of QualifiedTables of this QueryLeaf |
java.lang.String |
getGroupBy()
Returns the GROUP BY clause of the query leaf. |
RdbExpField[] |
getGroupByFields()
Gets the RdbExpFields of the GroupBy Clause. |
QualifiedTable[] |
getQualifiedTables()
Returns the associated QualifiedTables. |
RdbAdapter |
getRdbAdapter()
It retrieves the rdb adapter. |
java.lang.String |
getRdbAdapterName()
It retrieves the rdb adapter name. |
void |
removeQualifiedTable(QualifiedTable qt)
Adds a QualifiedTable to the QueryLeaf |
void |
removeRdbField(RdbExpField rdbField)
Adds an RdbExpField to the RdbExpQueryLeaf. |
void |
resetSqlRequest()
In case the SQL query was already computed, resets it to null. |
void |
setNoGroupBy(boolean noGroupBy)
Requires that the GROUP BY clause not be output by the getSqlRequest method. |
void |
setRdbAdapter(RdbAdapter adapter)
It assigns the rdb adapter. |
void |
setRdbAdapterName(java.lang.String name)
It assignes the rdb adapter name. |
void |
setRootJoinedTables(java.util.List rootjts)
|
Methods inherited from interface org.objectweb.medor.query.rdb.api.RdbQueryLeaf |
getSelectList, getSqlRequest, getSqlRequest, isSubquery, setIsSubquery |
Methods inherited from interface org.objectweb.medor.query.api.QueryLeaf |
getDataStore |
Methods inherited from interface org.objectweb.medor.query.api.QueryTree |
getDistinct, getName, getOrderBy, getTupleStructure, setDistinct, setOrderBy |
Methods inherited from interface org.objectweb.medor.query.api.AnnotationsHolder |
getAnnotations |
Methods inherited from interface org.objectweb.medor.query.api.FilteredQueryTree |
getQueryFilter, setQueryFilter |
Method Detail |
public RdbExpField addRdbField(java.lang.String fieldName, PType type, java.lang.String colName, QualifiedTable table) throws QueryLeafException
fieldName
- is the name of the Field to be added.type
- is the PTyme of the Field to be added.colName
- is the name of the column in the associated
QualifiedTable.table
- is the QualifiedTable from which the Field is to be created.
QueryLeafException
- if the QualifiedTable is not in the
set of QualifiedTables associatged with the current RdbExpQueryLeaf.public RdbExpField addRdbField(RdbExpField rdbField) throws QueryLeafException
rdbField
- is the RdbField to be added.
QueryLeafException
public void removeRdbField(RdbExpField rdbField) throws QueryLeafException
rdbField
- is the RdbField to be added.
QueryLeafException
public void addGroupBy(RdbExpField groupBy) throws QueryLeafException
groupBy
- : RdbExpField
QueryLeafException
- if this RdbExpField doesn't appears in
the list of the fields which will be projected in Select clausepublic RdbExpField[] getGroupByFields()
public QualifiedTable[] getQualifiedTables()
public void addQualifiedTable(QualifiedTable qt)
qt
- the QualifiedTable to be addedpublic void removeQualifiedTable(QualifiedTable qt) throws MedorException
qt
- the QualifiedTable to be added
MedorException
- if the QualifiedTable in not in the current leaf.public boolean containsQualifiedTable(QualifiedTable qt)
qt
- the QualifiedTable to be tested
public void setRdbAdapterName(java.lang.String name)
public java.lang.String getRdbAdapterName()
public void setRdbAdapter(RdbAdapter adapter)
public RdbAdapter getRdbAdapter()
public void setRootJoinedTables(java.util.List rootjts)
public void resetSqlRequest()
public void setNoGroupBy(boolean noGroupBy)
noGroupBy
- is true if no GROUP BY clause should be output (false by
default).public java.lang.String getGroupBy()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |