org.objectweb.medor.query.rdb.lib
Class AggregateRdbQueryNode
java.lang.Object
|
+--org.objectweb.medor.lib.BasicTupleStructure
|
+--org.objectweb.medor.query.lib.BasicQueryTree
|
+--org.objectweb.medor.query.lib.BasicQueryNode
|
+--org.objectweb.medor.query.lib.Nest
|
+--org.objectweb.medor.query.rdb.lib.AggregateRdbQueryNode
- All Implemented Interfaces:
- java.lang.Cloneable, Cloneable, FilteredQueryTree, NestQueryNode, QueryLeaf, QueryNode, QueryTree, RdbQueryLeaf, TupleStructure
- public class AggregateRdbQueryNode
- extends Nest
- implements RdbQueryLeaf, NestQueryNode
This class represents a QueryLeaf which contains aggregate functions.
It is built on top of a RbdQueryLeaf.
Field Summary |
protected boolean |
debug
|
protected Logger |
log
|
Method Summary |
DataStore |
getDataStore()
|
java.lang.String |
getName()
It returns the name of the query tree. |
java.lang.String |
getSelectList(java.lang.String selectList,
java.util.ArrayList selectFields,
boolean qualified)
|
java.lang.String |
getSqlRequest(ParameterOperand[] pos)
Builds and returns the SQL query as a String corresponding to the
current RdbExpQueryLeaf. |
java.lang.String |
getSqlRequest(ParameterOperand[] pos,
java.util.ArrayList al)
Returns the associated SQL query. |
boolean |
isSubquery()
Is the current query leaf a subquery (in particular for the case of
aggregates). |
void |
setIsSubquery(boolean subquery)
Indicates whether the current RdbExpQueryLeaf is a subquery of another
Rdb query leaf (in particular in the case of subqueries). |
Methods inherited from class org.objectweb.medor.query.lib.BasicQueryNode |
addCalculatedField, addChild, addField, addPropagatedField, clone, getChildren, getDistinct, getFieldName, getOptimizationMetaData, getQueryFilter, getTupleLoader, getTupleStructure, removeField, replace, setDistinct, setTupleLoader, updateCalculatedField, updateChildren, updatePropagatedField |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.medor.query.api.QueryNode |
addCalculatedField, addPropagatedField, getChildren, getOptimizationMetaData, getTupleLoader, getType, removeField, replace, setTupleLoader, updateCalculatedField, updatePropagatedField |
log
protected Logger log
debug
protected boolean debug
AggregateRdbQueryNode
public AggregateRdbQueryNode(QueryTreeField[] groupedFields,
java.lang.String groupedFieldName,
QueryTreeField[] groupByFields,
BasicRdbExpQueryLeaf subQL,
OptimizationMetaData optimizationMD,
DataStore ds,
java.lang.String nodeName)
throws MedorException
- Constructs a RDB QueryNode for an aggregation.
The SQL request (string) will be calculated.
- Parameters:
ds
- is the DataStore associated to the QueryLeaf to be created
- Throws:
QueryLeafException
- if the QualifiedTables have all the same
names, and in this case also the same aliases.
MedorException
getName
public java.lang.String getName()
- Description copied from interface:
QueryTree
- It returns the name of the query tree.
- Specified by:
getName
in interface QueryTree
- Overrides:
getName
in class BasicQueryNode
getSqlRequest
public java.lang.String getSqlRequest(ParameterOperand[] pos,
java.util.ArrayList al)
throws MedorException
- Description copied from interface:
RdbQueryLeaf
- Returns the associated SQL query.
n the case of an RdbExpQueryLeaf, the query is computed.
- Specified by:
getSqlRequest
in interface RdbQueryLeaf
- Returns:
- the SQL query associated to the RdbQueryLeaf, as a String.
- Throws:
MedorException
- in the case of RdbExpQueryLeaves if the
SQL request cannot be computed from the associated Expression
getSqlRequest
public java.lang.String getSqlRequest(ParameterOperand[] pos)
throws MedorException
- Builds and returns the SQL query as a String corresponding to the
current RdbExpQueryLeaf.
The SQL query is computed using the aggregate fields and relies on
the child RdbQueryLeaf.
- Specified by:
getSqlRequest
in interface RdbQueryLeaf
- Returns:
- the SQL query as a String.
- Throws:
MedorException
- in the case of RdbExpQueryLeaves if the
SQL request cannot be computed from the associated Expression
getSelectList
public java.lang.String getSelectList(java.lang.String selectList,
java.util.ArrayList selectFields,
boolean qualified)
throws MedorException
- Specified by:
getSelectList
in interface RdbQueryLeaf
MedorException
getDataStore
public DataStore getDataStore()
- Specified by:
getDataStore
in interface QueryLeaf
setIsSubquery
public void setIsSubquery(boolean subquery)
- Description copied from interface:
RdbQueryLeaf
- Indicates whether the current RdbExpQueryLeaf is a subquery of another
Rdb query leaf (in particular in the case of subqueries).
The default value is false.
- Specified by:
setIsSubquery
in interface RdbQueryLeaf
- Parameters:
subquery
- is true when the current RdbExpQueryLeaf is a subquery
of another Rdb query leaf/node, false otherwise.
isSubquery
public boolean isSubquery()
- Description copied from interface:
RdbQueryLeaf
- Is the current query leaf a subquery (in particular for the case of
aggregates).
- Specified by:
isSubquery
in interface RdbQueryLeaf
- Returns:
- true if the current RdbExpQueryLeaf is a subquery