Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.graph.query.optimize
Class ReplaceViews

    java.lang.Object
      org.modeshape.graph.query.optimize.ReplaceViews

All Implemented Interfaces:
  OptimizerRule

    @Immutable
    public class ReplaceViews

extends Object
implements OptimizerRule

An `optimizer rule` that replaces any SOURCE nodes that happen to be `views`. This rewriting changes all of the elements of the plan that reference the SOURCE and it's columns, including criteria, project nodes, etc.

For example, here is the portion of a plan that uses a single SOURCE that is defined to use a view.

              ...
               |
            SOURCE1

This same SOURCE node is then replaced with the view's definition:

              ...
               |
            PROJECT      with the list of columns being SELECTed
               |
            SELECT1
               |         One or more SELECT plan nodes that each have
            SELECT2      a single non-join constraint that are then all AND-ed
               |         together
            SELECTn
               |
            SOURCE

Field Summary
`static ReplaceViews` | `INSTANCE`

Constructor Summary
`ReplaceViews()`

Method Summary
`PlanNode` | `execute(QueryContext context, PlanNode plan, LinkedList<OptimizerRule> ruleStack)` Optimize the supplied plan using the supplied context, hints, and yet-to-be-run rules.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### INSTANCE

    public static final ReplaceViews INSTANCE

Constructor Detail

### ReplaceViews

    public ReplaceViews()

Method Detail

### execute

    public PlanNode execute(QueryContext context,
                            PlanNode plan,
                            LinkedList<OptimizerRule> ruleStack)

  Optimize the supplied plan using the supplied context, hints, and yet-to-be-run rules.

  Specified by:
    `execute` in interface `OptimizerRule`
  Parameters:
    `context` - the context in which the query is being optimized; never null
    `plan` - the plan to be optimized; never null
    `ruleStack` - the stack of rules that will be run after this rule; never null
  Returns:
    the optimized plan; never null
  See Also:
    `OptimizerRule.execute(org.modeshape.graph.query.QueryContext, org.modeshape.graph.query.plan.PlanNode, java.util.LinkedList)`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`
  See Also:
    `Object.toString()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.