org.objectweb.medor.query.rdb.lib
Class BasicRdbStringQueryLeaf

java.lang.Object
  extended byBasicCloneable
      extended byorg.objectweb.medor.lib.BasicTupleStructure
          extended byorg.objectweb.medor.query.lib.BasicQueryTree
              extended byorg.objectweb.medor.query.rdb.lib.BasicRdbQueryLeaf
                  extended byorg.objectweb.medor.query.rdb.lib.BasicRdbStringQueryLeaf
All Implemented Interfaces:
Cloneable, java.lang.Cloneable, QueryLeaf, QueryTree, RdbQueryLeaf, RdbStringQueryLeaf, TupleStructure

public class BasicRdbStringQueryLeaf
extends BasicRdbQueryLeaf
implements RdbStringQueryLeaf

This class represents a QueryLeaf that maps onto a relational database store.

See Also:
Serialized Form

Field 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
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
 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)
          Returns the associated SQL query.
 java.lang.String getSqlRequest(ParameterOperand[] pos, java.util.ArrayList al)
          Returns the associated SQL query.
 
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
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.api.Cloneable
clone
 

Constructor Detail

BasicRdbStringQueryLeaf

public BasicRdbStringQueryLeaf()

BasicRdbStringQueryLeaf

public BasicRdbStringQueryLeaf(DataStore ds,
                               java.lang.String query,
                               java.lang.String nodeName)
Constructs a BasicRdbStringQueryLeaf from an SQL string.

Method Detail

addRdbField

public RdbField addRdbField(java.lang.String name,
                            PType type,
                            java.lang.String colName)
Description copied from interface: RdbStringQueryLeaf
Adds a Field to the RdbExpQueryLeaf

Specified by:
addRdbField in interface RdbStringQueryLeaf
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.
Returns:
the created RdbExpField.

getSqlRequest

public java.lang.String getSqlRequest(ParameterOperand[] pos)
Description copied from interface: RdbQueryLeaf
Returns the associated SQL query.

In 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.

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

getSelectList

public java.lang.String getSelectList(java.lang.String selectList,
                                      java.util.ArrayList selectFields,
                                      boolean qualified)
                               throws MedorException
Description copied from interface: RdbQueryLeaf
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 fields
qualified - indicates whether the field names should be qualified with the table name or not.
Returns:
the list of qualified columns for the SELECT clause
Throws:
MedorException