org.modeshape.jcr.query.process

## Class QueryEngine

- java.lang.Object
- - org.modeshape.jcr.query.process.QueryEngine

- Direct Known Subclasses:
    LuceneQueryEngine

      @ThreadSafe
      public class QueryEngine
      extends Object

  A query engine that is able to execute formal queries expressed in the Graph API's `Abstract Query Model`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Optimizer` | `optimizer`
    `protected Planner` | `planner`
    `protected Processor` | `processor`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryEngine(Planner planner, Optimizer optimizer, Processor processor)` Create a new query engine given the `planner`, `optimizer`, `processor`, and `schemata`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected QueryResultColumns` | `determineQueryResultColumns(PlanNode optimizedPlan, PlanHints hints)`
    `QueryResults` | `execute(QueryContext context, QueryCommand query)` Execute the supplied query by planning, optimizing, and then processing it.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### planner

          protected final Planner planner

    - #### optimizer

          protected final Optimizer optimizer

    - #### processor

          protected final Processor processor

  - ### Constructor Detail

    - #### QueryEngine

          public QueryEngine(Planner planner,
                     Optimizer optimizer,
                     Processor processor)

      Create a new query engine given the `planner`, `optimizer`, `processor`, and `schemata`.
      Parameters:
        `planner` - the planner that should be used to generate canonical query plans for the queries; may be null if the `CanonicalPlanner` should be used
        `optimizer` - the optimizer that should be used to optimize the canonical query plan; may be null if the `RuleBasedOptimizer` should be used
        `processor` - the processor implementation that should be used to process the planned query and return the results
      Throws:
        `IllegalArgumentException` - if the processor reference is null

  - ### Method Detail

    - #### execute

          public QueryResults execute(QueryContext context,
                             QueryCommand query)
                               throws QueryCancelledException,
                                      RepositoryException

      Execute the supplied query by planning, optimizing, and then processing it.
      Parameters:
        `context` - the context in which the query should be executed
        `query` - the query that is to be executed
      Returns:
        the query results; never null
      Throws:
        `IllegalArgumentException` - if the context or query references are null
        `QueryCancelledException` - if the query was cancelled
        `RepositoryException` - if there was a problem executing the query

    - #### determineQueryResultColumns

          protected QueryResultColumns determineQueryResultColumns(PlanNode optimizedPlan,
                                                       PlanHints hints)

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