|
|||||||||||
| 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.rdb.lib.BasicRdbQueryLeaf
org.objectweb.medor.query.rdb.lib.BasicRdbStringQueryLeaf
This class represents a QueryLeaf that maps onto a relational database store.
| Field Summary | |
protected Expression |
sqlFilter
|
| Fields inherited from class org.objectweb.medor.query.rdb.lib.BasicRdbQueryLeaf |
ds, isSubquery, query |
| Fields inherited from class org.objectweb.medor.query.lib.BasicQueryTree |
annotations, distinct, indexes, name, orderfields |
| Fields inherited from class org.objectweb.medor.lib.BasicTupleStructure |
fields, logger, name2field |
| Constructor Summary | |
BasicRdbStringQueryLeaf()
|
|
BasicRdbStringQueryLeaf(DataStore ds,
java.lang.String query,
java.lang.String nodeName)
Constructs a BasicRdbStringQueryLeaf from an SQL string. |
|
| Method Summary | |
RdbField |
addRdbField(java.lang.String name,
PType type,
java.lang.String colName)
Adds a Field to the RdbExpQueryLeaf |
Expression |
getQueryFilter()
Retrieves the filter associated to the QueryTree. |
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 |
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)
Returns the associated SQL query. |
void |
setQueryFilter(Expression exp)
Sets the filter associated to the FilteredQueryTree. |
| Methods inherited from class org.objectweb.medor.query.rdb.lib.BasicRdbQueryLeaf |
clone, getDataStore, isSubquery, setDataStore, setIsSubquery |
| 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.rdb.api.RdbQueryLeaf |
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.api.Cloneable |
clone |
| Field Detail |
protected Expression sqlFilter
| Constructor Detail |
public BasicRdbStringQueryLeaf()
public BasicRdbStringQueryLeaf(DataStore ds,
java.lang.String query,
java.lang.String nodeName)
| Method Detail |
public RdbField addRdbField(java.lang.String name,
PType type,
java.lang.String colName)
RdbStringQueryLeaf
addRdbField in interface RdbStringQueryLeafname - 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.
public java.lang.String getSqlRequest(ParameterOperand[] pos,
boolean rangeStartAt,
boolean rangeSize)
RdbQueryLeafIn the case of an RdbExpQueryLeaf, the query is computed.
getSqlRequest in interface RdbQueryLeafpos - 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
public java.lang.String getSqlRequest(ParameterOperand[] pos,
java.util.ArrayList al,
boolean rangeStartAt,
boolean rangeSize)
throws MedorException
RdbQueryLeafIn the case of an RdbExpQueryLeaf, the query is computed.
getSqlRequest in interface RdbQueryLeafpos - 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
public java.lang.String getSelectList(java.lang.String selectList,
java.util.ArrayList selectFields,
boolean qualified)
throws MedorException
RdbQueryLeaf
getSelectList in interface RdbQueryLeafselectList - 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.
MedorExceptionpublic Expression getQueryFilter()
FilteredQueryTree
getQueryFilter in interface FilteredQueryTreeExpressionpublic void setQueryFilter(Expression exp)
FilteredQueryTreeFor a QueryNode:
This method also updates the list of QueryTree children of the current QueryNode according to the FieldOperands present in the Expression.
Usage constraint: if the QueryNode already has an associated Expression, and if this Expression has been modified, the user is requested to call the setQueryFilter method after the modification.
For a RbdQueryLeaf:
It sets the filter associated to the RbdQueryLeaf. This filter is represented by an Expression. Unlike the filter of a QueryNode, is applies to its own Fields, instead of the Fields of its children.
setQueryFilter in interface FilteredQueryTreeexp - is the Expression representing the query filter of the current
QueryNode.Expression
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||