|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBasicCloneable
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
This class represents a QueryLeaf which contains aggregate functions.
It is built on top of a RbdQueryLeaf.
Field Summary | |
protected DataStore |
ds
|
protected RdbExpField |
groupByField
|
protected java.lang.String |
query
|
protected RdbExpQueryLeaf |
subRdbQL
|
Fields inherited from class org.objectweb.medor.query.lib.Nest |
myGroupByFields, nestedField, theGroupByFields |
Fields inherited from class org.objectweb.medor.query.lib.BasicQueryNode |
children, filter, indexes, inner, tupleLoader |
Fields inherited from class org.objectweb.medor.query.lib.BasicQueryTree |
annotations, distinct, name, orderfields |
Fields inherited from class org.objectweb.medor.lib.BasicTupleStructure |
fields, logger, name2field |
Constructor Summary | |
AggregateRdbQueryNode()
|
|
AggregateRdbQueryNode(QueryTreeField[] groupedFields,
java.lang.String groupedFieldName,
QueryTreeField[] groupByFields,
BasicRdbExpQueryLeaf subQL,
DataStore ds,
java.lang.String nodeName)
Constructs a RDB QueryNode for an aggregation. |
Method Summary | |
java.lang.Object |
clone(java.lang.Object clone,
java.util.Map obj2clone)
|
DataStore |
getDataStore()
|
Expression |
getQueryFilter()
Redefines getQueryFilter using the filter of the subquery. |
java.lang.String |
getSelectList(java.lang.String selectList,
java.util.ArrayList selectFields,
boolean qualified)
Builds the SELECT clause of the query (without "SELECT "). |
java.lang.String |
getSqlDelete(ParameterOperand[] pos)
Returns the associated SQL DELETE query for deleting data. |
java.lang.String |
getSqlRequest(ParameterOperand[] pos,
java.util.ArrayList al,
boolean rangeStartAt,
boolean rangeSize)
Returns the associated SQL queryn giving the list of SELECT fields as an input parameter. |
java.lang.String |
getSqlRequest(ParameterOperand[] pos,
boolean rangeStartAt,
boolean rangeSize)
Builds and returns the SQL query as a String corresponding to the current RdbExpQueryLeaf. |
java.lang.String |
getSqlUpdate(ParameterOperand[] pos,
Expression updateExpression)
Returns the associated SQL UPDATE query for deleting data. |
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.Nest |
getNestedField, getNestingField, getNestingFields, getType, replaceNestedField, replaceNestingField, setQueryFilter |
Methods inherited from class org.objectweb.medor.query.lib.BasicQueryNode |
addCalculatedField, addChild, addField, addPropagatedField, getChildren, getFieldName, getTupleLoader, isOuter, removeField, replace, setOuter, setTupleLoader, updateCalculatedField, updateChildren, updatePropagatedField |
Methods inherited from class org.objectweb.medor.query.lib.BasicQueryTree |
getAnnotations, getDistinct, getName, getOrderBy, getTupleStructure, setDistinct, setOrderBy |
Methods inherited from class org.objectweb.medor.lib.BasicTupleStructure |
contains, contains, getField, getField, getFieldRank, getFields, getSize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.NestQueryNode |
getNestedField, getNestingField, getNestingFields, replaceNestedField, replaceNestingField |
Methods inherited from interface org.objectweb.medor.query.api.QueryNode |
addCalculatedField, addPropagatedField, getChildren, getTupleLoader, getType, isOuter, removeField, replace, setOuter, setTupleLoader, updateCalculatedField, updatePropagatedField |
Methods inherited from interface org.objectweb.medor.query.api.FilteredQueryTree |
setQueryFilter |
Methods inherited from interface org.objectweb.medor.api.Cloneable |
clone |
Field Detail |
protected DataStore ds
protected RdbExpField groupByField
protected RdbExpQueryLeaf subRdbQL
protected java.lang.String query
Constructor Detail |
public AggregateRdbQueryNode()
public AggregateRdbQueryNode(QueryTreeField[] groupedFields, java.lang.String groupedFieldName, QueryTreeField[] groupByFields, BasicRdbExpQueryLeaf subQL, DataStore ds, java.lang.String nodeName) throws MedorException
The SQL request (string) will be calculated.
ds
- is the DataStore associated to the QueryLeaf to be created
QueryLeafException
- if the QualifiedTables have all the same
names, and in this case also the same aliases.
MedorException
Method Detail |
public java.lang.Object clone(java.lang.Object clone, java.util.Map obj2clone) throws java.lang.CloneNotSupportedException
clone
in class Nest
java.lang.CloneNotSupportedException
public java.lang.String getSqlRequest(ParameterOperand[] pos, java.util.ArrayList al, boolean rangeStartAt, boolean rangeSize) throws MedorException, ExpressionException
RdbQueryLeaf
In the case of an RdbExpQueryLeaf, the query is computed.
getSqlRequest
in interface RdbQueryLeaf
pos
- is an array of ParameterOperandal
- is the input Array of fields for constructing the
SELECT clause.rangeStartAt
- is true for range queries where the first row to be
returned in the case of a range query is greater than 0.rangeSize
- is true for range queries where the number of rows to be
returned in the case of a range query is less than Integer.MAXVALUE
MedorException
- in the case of RdbExpQueryLeaves if the
SQL request cannot be computed from the associated Expression
ExpressionException
public java.lang.String getSqlRequest(ParameterOperand[] pos, boolean rangeStartAt, boolean rangeSize) throws MedorException, ExpressionException
The SQL query is computed using the aggregate fields and relies on the child RdbQueryLeaf.
getSqlRequest
in interface RdbQueryLeaf
pos
- is an array of ParameterOperandrangeStartAt
- is true for range queries where the first row to be
returned in the case of a range query is greater than 0.rangeSize
- is true for range queries where the number of rows to be
returned in the case of a range query is less than Integer.MAXVALUE
MedorException
- in the case of RdbExpQueryLeaves if the
SQL request cannot be computed from the associated Expression
ExpressionException
public java.lang.String getSqlDelete(ParameterOperand[] pos)
RdbQueryLeaf
getSqlDelete
in interface RdbQueryLeaf
pos
- is an array of ParameterOperand
public java.lang.String getSqlUpdate(ParameterOperand[] pos, Expression updateExpression)
RdbQueryLeaf
getSqlUpdate
in interface RdbQueryLeaf
pos
- is an array of ParameterOperandupdateExpression
- is a medor expression describing the update
assignement of value. The expression must be AND expressions of
equality between field operand and an operand (or parameter operand).
public java.lang.String getSelectList(java.lang.String selectList, java.util.ArrayList selectFields, boolean qualified) throws MedorException
RdbQueryLeaf
getSelectList
in interface RdbQueryLeaf
selectList
- is the start of the SELECT clause to which the list
of qualified columns is appended.selectFields
- is the fields for the SELECT clause. Such fields can
either be plain fields, or can be aggregate fieldsqualified
- indicates whether the field names should be qualified
with the table name or not.
MedorException
public DataStore getDataStore()
getDataStore
in interface QueryLeaf
public void setIsSubquery(boolean subquery)
RdbQueryLeaf
The default value is false.
setIsSubquery
in interface RdbQueryLeaf
subquery
- is true when the current RdbExpQueryLeaf is a subquery
of another Rdb query leaf/node, false otherwise.public boolean isSubquery()
RdbQueryLeaf
isSubquery
in interface RdbQueryLeaf
public Expression getQueryFilter()
getQueryFilter
in interface FilteredQueryTree
getQueryFilter
in class BasicQueryNode
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |