|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.medor.optim.lib.BasicRule
org.objectweb.medor.optim.jorm.JormRule
org.objectweb.medor.optim.jorm.JormFlatten2Rdb
This rules transforms a QueryTree built on top of JORM Extents into a QueryTree built on top of RdbExpQueryLeaves.
The initial QueryTree can be a JORM Extent, or composed of one QueryNode with one or several JORM Extent. The FlattenQueryTree rewriting rule can produce such a QueryTree.
The resulting QueryTree always has a SelectProject node on top of the RdbExpQueryLeaf, in case of CalculatedFields (for example the PName).
Nested Class Summary | |
class |
JormFlatten2Rdb.Join
A join linking two relational tables. |
class |
JormFlatten2Rdb.JoinColumn
It describes the join between two columns |
class |
JormFlatten2Rdb.RdbJormExtentMapping
Represents the mapping of a JormExtent over relational tables. |
Nested classes inherited from class org.objectweb.medor.optim.lib.BasicRule |
BasicRule.ModifiedExpression |
Field Summary |
Fields inherited from class org.objectweb.medor.optim.lib.BasicRule |
debug, log |
Constructor Summary | |
JormFlatten2Rdb()
|
Method Summary | |
Expression |
getDecode(PNameField pnf,
BasicRdbExpQueryLeaf leaf,
boolean add)
Create an expression to decode a PName. |
QueryTreeField |
getField(Field old,
BasicRdbExpQueryLeaf leaf,
boolean add)
Is a shorcut to the getField(String, PType, JormExtent, BasicRdbExpQueryLeaf, boolean) method. |
QueryTreeField |
getField(java.lang.String fieldname,
JormExtent extent,
BasicRdbExpQueryLeaf leaf,
boolean add)
Shortcut to the getField(String, PType, JormExtent, BasicRdbExpQueryLeaf, boolean) method. |
QueryTreeField |
getField(java.lang.String fieldname,
PType type,
JormExtent extent,
BasicRdbExpQueryLeaf leaf,
boolean add)
Adds a field in a leaf if it is not already present. |
JormFlatten2Rdb.RdbJormExtentMapping |
getMapping(int i)
Retrieves the RdbJormExtentMapping at the position i the packet. |
JormFlatten2Rdb.RdbJormExtentMapping |
getMapping(JormExtent je)
Retrieves the RdbJormExtentMapping at the position i the packet. |
QueryTree |
rewrite(QueryTree qt,
QueryNode parent)
This method applies a single rule. |
Expression |
updateFieldOfExpression(Expression e,
BasicRdbExpQueryLeaf leaf,
boolean add)
Replaces the uses of the old fields of extents by fields of a leaf. |
Methods inherited from class org.objectweb.medor.optim.jorm.JormRule |
getClassMapping, getGenClassMapping, getJORMFieldName, getPEM, getPNCOperand, getPrimitiveElement |
Methods inherited from class org.objectweb.medor.optim.lib.BasicRule |
replaceUsage, rewrite |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JormFlatten2Rdb()
Method Detail |
public QueryTree rewrite(QueryTree qt, QueryNode parent) throws MedorException
RewriteRule
It is typically called by the QueryRewriter for applying the entire rewriting process.
qt
- the QueryTree to be rewrittenparent
- the parent QueryNode for which modification of propagated
field, if they are replaced in the qt, should be done.
MedorException
public JormFlatten2Rdb.RdbJormExtentMapping getMapping(int i)
i
- is position of the expected RdbJormExtentMapping
public JormFlatten2Rdb.RdbJormExtentMapping getMapping(JormExtent je)
je
- is the jorm extent which the mapping is expected
public Expression updateFieldOfExpression(Expression e, BasicRdbExpQueryLeaf leaf, boolean add) throws MedorException, ExpressionException
e
- the expression to updateleaf
- is the field containing the new field.add
- indicates whether the Field should be added (it is projected)
or not (it is only in the Filter).
MedorException
- if it is not possible to fetch a new field in the
leaf or if the PName equality are malformed
ExpressionException
public Expression getDecode(PNameField pnf, BasicRdbExpQueryLeaf leaf, boolean add) throws MedorException
pnf
- is the PNameField linked to JormExtent which is the old
representation of the PName.leaf
- is the leaf which contains the field of the NameDef. It the
fields do not exist then they are created.
MedorException
- if the NameDef is not supported or if the a field
can not be created in the leaf.public QueryTreeField getField(Field old, BasicRdbExpQueryLeaf leaf, boolean add) throws MedorException
The fieldname, the type and the extent values are calculated from the old Field.
old
- the old field
MedorException
- if an error occurs during the real getField call.public QueryTreeField getField(java.lang.String fieldname, JormExtent extent, BasicRdbExpQueryLeaf leaf, boolean add) throws MedorException
The field type is calculated looking for the field in the JORM meta information.
MedorException
- if the field is not found in the JORM meta
information or if an error occurs during the real getField call.public QueryTreeField getField(java.lang.String fieldname, PType type, JormExtent extent, BasicRdbExpQueryLeaf leaf, boolean add) throws MedorException
fieldname
- is the field name of the expected field.type
- is the jorm type of expected field.extent
- is the extent containing the old version of the expected
field.leaf
- is the leaf which must contain the expected field after the
the method calladd
- indicates whether the field should be added to the leaf
MedorException
- if no old field is not available on the extent
or if no mapping is available for the field.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |