|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An RdbQueryLeaf represents a query leaf which encapsulates access to a relational database.
A SQL query is associated to an RdbQueryLeaf.
RdbExpQueryLeaf
,
RdbStringQueryLeaf
Method Summary | |
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 selectFields,
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. |
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 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 |
Method Detail |
public java.lang.String getSqlRequest(ParameterOperand[] pos, java.util.ArrayList selectFields, boolean rangeStartAt, boolean rangeSize) throws MedorException, ExpressionException
In the case of an RdbExpQueryLeaf, the query is computed.
pos
- is an array of ParameterOperandselectFields
- 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
In the case of an RdbExpQueryLeaf, the query is computed.
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 getSelectList(java.lang.String selectList, java.util.ArrayList selectFields, boolean qualified) throws MedorException
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 boolean isSubquery()
public void setIsSubquery(boolean subquery)
The default value is false.
subquery
- is true when the current RdbExpQueryLeaf is a subquery
of another Rdb query leaf/node, false otherwise.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |