| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
BasicCloneableorg.objectweb.medor.lib.BasicTupleStructureorg.objectweb.medor.query.lib.BasicQueryTreeorg.objectweb.medor.query.rdb.lib.BasicRdbQueryLeaforg.objectweb.medor.query.rdb.lib.BasicRdbExpQueryLeafField Summary |
Fields inherited from class org.objectweb.medor.query.rdb.lib.BasicRdbQueryLeaf | |
ds, isSubquery, query, sqlFilter | |
Fields inherited from class org.objectweb.medor.query.lib.BasicQueryTree | |
distinct, indexes, name, orderfields | |
Fields inherited from class org.objectweb.medor.lib.BasicTupleStructure | |
fields, logger, name2field | |
Constructor Summary | |
| |
| |
Method Summary | |
void | |
RdbExpField |
|
RdbExpField |
|
Object |
|
boolean | |
protected String |
|
RdbExpField | |
protected static String |
|
QualifiedTable[] |
|
Expression |
|
RdbAdapter | |
String | |
String |
|
String |
|
String |
|
void | |
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
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 | |
clone, getDistinct, getName, getOrderBy, getTupleStructure, setDistinct, setOrderBy | |
Methods inherited from class org.objectweb.medor.lib.BasicTupleStructure | |
clone, contains, contains, getField, getField, getFieldRank, getFields, getSize | |
public BasicRdbExpQueryLeaf()
public BasicRdbExpQueryLeaf(DataStore ds, QualifiedTable[] from, String nodeName) throws QueryLeafException
Constructs a BasicRdbExpQueryLeaf from an Expression and a set of QualifiedTables. The SQL request (string) will be calculated.
- Parameters:
ds- is the DataStore associated to the QueryLeaf to be createdfrom- is the array of QualifiedTables 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.
public void addQualifiedTable(QualifiedTable qt)
- Specified by:
- addQualifiedTable in interface RdbExpQueryLeaf
public RdbExpField addRdbField(String name, PType type, String colName, QualifiedTable table) throws QueryLeafException
Adds a Field to the RdbExpQueryLeaf
- Specified by:
- addRdbField in interface RdbExpQueryLeaf
- Parameters:
name- 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.
- Returns:
- the created RdbExpField.
public RdbExpField addRdbField(RdbExpField rdbField) throws QueryLeafException
Adds an RdbExpField to the RdbExpQueryLeaf
- Specified by:
- addRdbField in interface RdbExpQueryLeaf
- Parameters:
rdbField- is the RdbField to be added.
public Object clone(Object clone,
Map obj2clone)
throws CloneNotSupportedException
- Overrides:
- clone in interface BasicRdbQueryLeaf
public boolean containsQualifiedTable(QualifiedTable qt)
- Specified by:
- containsQualifiedTable in interface RdbExpQueryLeaf
protected String getFromList()
Builds the FROM clause of the query (without "FROM").
- Returns:
- the list of qualified table names for the FROM clause tables is appended.
public RdbExpField getGroupByField()
- Specified by:
- getGroupByField in interface RdbExpQueryLeaf
protected static String getQualifiedFieldName(RdbExpField field)
Builds the qualified name of a RdbExpField.
- Parameters:
field- is the RdbExpField for which the qualified name is built.
- Returns:
- the qualified name of an RdbExpField.
public QualifiedTable[] getQualifiedTables()
Returns the associated QualifiedTables.
- Specified by:
- getQualifiedTables in interface RdbExpQueryLeaf
- Returns:
- the array of associated QualifiedTables.
public Expression getQueryFilter()
Retrieves the filter associated to the RbdQueryLeaf.
- Specified by:
- getQueryFilter in interface FilteredQueryTree
- Returns:
- the Medor Expression representing the filter to be applied to the relational source tables.
public RdbAdapter getRdbAdapter()
- Specified by:
- getRdbAdapter in interface RdbExpQueryLeaf
public String getRdbAdapterName()
- Specified by:
- getRdbAdapterName in interface RdbExpQueryLeaf
public String getSelectList(String selectList,
ArrayList selectFields,
boolean qualified)Builds the SELECT clause of the query (without "SELECT ").
- Specified by:
- getSelectList in interface RdbQueryLeaf
- Parameters:
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.
- Returns:
- the list of qualified columns for the SELECT clause
public String getSqlRequest(ParameterOperand[] pos,
ArrayList selectFields,
int rangeStartAt,
int rangeSize)
throws MedorException,
ExpressionExceptionReturns the associated SQL queryn giving the list of SELECT fields as an input parameter. In the case of an RdbExpQueryLeaf, the query is computed.
- Specified by:
- getSqlRequest in interface RdbQueryLeaf
- Parameters:
pos- is an array of ParameterOperandselectFields- is the input Array of fields for constructing the SELECT clause.rangeStartAt- is the offset of the first row to be returned in the case of a range query, starting at 0.rangeSize- is the number of rows to be returned in the case of a range query.
- 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
public String getSqlRequest(ParameterOperand[] pos,
int rangeStartAt,
int rangeSize)
throws MedorException,
ExpressionExceptionReturns the associated SQL query. In the case of an RdbExpQueryLeaf, the query is computed.
- Specified by:
- getSqlRequest in interface RdbQueryLeaf
- Parameters:
pos- is an array of ParameterOperandrangeStartAt- is the offset of the first row to be returned in the case of a range query, starting at 0.rangeSize- is the number of rows to be returned in the case of a range query.
- 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
public void removeQualifiedTable(QualifiedTable qt) throws MedorException
- Specified by:
- removeQualifiedTable in interface RdbExpQueryLeaf
public void removeRdbField(RdbExpField rdbField) throws QueryLeafException
- Specified by:
- removeRdbField in interface RdbExpQueryLeaf
public void resetSqlRequest()
- Specified by:
- resetSqlRequest in interface RdbExpQueryLeaf
public void setGroupBy(RdbExpField groupBy) throws QueryLeafException
- Specified by:
- setGroupBy in interface RdbExpQueryLeaf
public void setQueryFilter(Expression exp)
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.
- Specified by:
- setQueryFilter in interface FilteredQueryTree
- Parameters:
exp- is the Medor Expression representing the filter to be applied to the relational source tables.
public void setRdbAdapter(RdbAdapter adapter)
- Specified by:
- setRdbAdapter in interface RdbExpQueryLeaf
public void setRdbAdapterName(String an)
- Specified by:
- setRdbAdapterName in interface RdbExpQueryLeaf
public void setRootJoinedTables(List rootjts)
- Specified by:
- setRootJoinedTables in interface RdbExpQueryLeaf