org.objectweb.medor.optim.api
Interface RewriteRule

All Known Subinterfaces:
LeafRewriteRule
All Known Implementing Classes:
BasicRule, GroupSameDBRule

public interface RewriteRule

This interface describes a rule used by the QueryTransformer.

It typically pushes selections, replaces a JORM scan with the corresp. RdbQueryLeaf, groups operations on the same data source if possible (depending on the evaluation capacity of the data source) into a single QueryLeaf, etc.


Method Summary
 QueryTree rewrite(QueryTree qt)
          This method applies a single rule.
 QueryTree rewrite(QueryTree qt, QueryNode parent)
          This method applies a single rule.
 

Method Detail

rewrite

public QueryTree rewrite(QueryTree qt,
                         QueryNode parent)
                  throws MedorException
This method applies a single rule.

It is typically called by the QueryRewriter for applying the entire rewriting process.

Parameters:
qt - the QueryTree to be rewritten
parent - the parent QueryNode for which modification of propagated field, if they are replaced in the qt, should be done.
Returns:
the rewritten QueryTree
Throws:
MedorException

rewrite

public QueryTree rewrite(QueryTree qt)
                  throws MedorException
This method applies a single rule. It is typically called by the QueryRewriter for applying the entire rewriting process.

It is the same method, but the QueryTree to be rewritten is the top QueryTree (no parent).

Parameters:
qt - the QueryTree to be rewritten
Returns:
the rewritten QueryTree
Throws:
MedorException