ExecutionEngine (Neo4j Community 2.1.0-M01 API)
Date: 2014-02-20

org.neo4j.cypher.javacompat

## Class ExecutionEngine

- java.lang.Object
- - org.neo4j.cypher.javacompat.ExecutionEngine

-     public class ExecutionEngine
      extends Object

  To run a Cypher query, use this class.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExecutionEngine(GraphDatabaseService database)` Creates an execution engine around the give graph database
    `ExecutionEngine(GraphDatabaseService database, org.neo4j.kernel.impl.util.StringLogger logger)` Creates an execution engine around the give graph database

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ExecutionResult` | `execute(String query)` Executes a query and returns an iterable that contains the result set
    `ExecutionResult` | `execute(String query, Map<String,Object> params)` Executes a query and returns an iterable that contains the result set
    `String` | `prettify(String query)` Turns a valid Cypher query and returns it with keywords in uppercase, and new-lines in the appropriate places.
    `ExecutionResult` | `profile(String query)` Profiles a query and returns an iterable that contains the result set.
    `ExecutionResult` | `profile(String query, Map<String,Object> params)` Profiles a query and returns an iterable that contains the result set.

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

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

- - ### Constructor Detail

    - #### ExecutionEngine

          public ExecutionEngine(GraphDatabaseService database)

      Creates an execution engine around the give graph database
      Parameters:
        `database` - The database to wrap

    - #### ExecutionEngine

          public ExecutionEngine(GraphDatabaseService database,
                         org.neo4j.kernel.impl.util.StringLogger logger)

      Creates an execution engine around the give graph database
      Parameters:
        `database` - The database to wrap
        `logger` - A logger for cypher-statements

  - ### Method Detail

    - #### execute

          public ExecutionResult execute(String query)
                                  throws org.neo4j.cypher.CypherException

      Executes a query and returns an iterable that contains the result set
      Parameters:
        `query` - The query to execute
      Returns:
        A ExecutionResult that contains the result set
      Throws:
        `org.neo4j.cypher.SyntaxException` - If the Query contains errors, a SyntaxException exception might be thrown
        `org.neo4j.cypher.CypherException`

    - #### execute

          public ExecutionResult execute(String query,
                                Map<String,Object> params)
                                  throws org.neo4j.cypher.CypherException

      Executes a query and returns an iterable that contains the result set
      Parameters:
        `query` - The query to execute
        `params` - Parameters for the query
      Returns:
        A ExecutionResult that contains the result set
      Throws:
        `org.neo4j.cypher.SyntaxException` - If the Query contains errors, a SyntaxException exception might be thrown
        `org.neo4j.cypher.CypherException`

    - #### profile

          public ExecutionResult profile(String query)
                                  throws org.neo4j.cypher.CypherException

      Profiles a query and returns an iterable that contains the result set. Note that in order to gather profiling information, this actually executes the query as well. You can wrap a call to this in a transaction that you roll back if you don't want the query to have an actual effect on the data.
      Parameters:
        `query` - The query to profile
      Returns:
        A ExecutionResult that contains the result set
      Throws:
        `org.neo4j.cypher.SyntaxException` - If the Query contains errors, a SyntaxException exception might be thrown
        `org.neo4j.cypher.CypherException`

    - #### profile

          public ExecutionResult profile(String query,
                                Map<String,Object> params)
                                  throws org.neo4j.cypher.CypherException

      Profiles a query and returns an iterable that contains the result set. Note that in order to gather profiling information, this actually executes the query as well. You can wrap a call to this in a transaction that you roll back if you don't want the query to have an actual effect on the data.
      Parameters:
        `query` - The query to profile
        `params` - Parameters for the query
      Returns:
        A ExecutionResult that contains the result set
      Throws:
        `org.neo4j.cypher.SyntaxException` - If the Query contains errors, a SyntaxException exception might be thrown
        `org.neo4j.cypher.CypherException`

    - #### prettify

          public String prettify(String query)

      Turns a valid Cypher query and returns it with keywords in uppercase, and new-lines in the appropriate places.
      Parameters:
        `query` - The query to make pretty
      Returns:
        The same query, but prettier

Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.