Package org.neo4j.cypher.javacompat

Examples of org.neo4j.cypher.javacompat.ExecutionEngine


  }

  @Nonnull
  public static String dumpToText( @Nonnull GraphDatabaseService db ) {
    try ( Transaction tx = db.beginTx() ) {
      ExecutionResult result = new ExecutionEngine( db ).execute( "MATCH (n)\n" + "RETURN n;" );
      return result.dumpToString();
    }
  }
View Full Code Here


      }

      assertNotNull(rel);

      GraphDatabaseService graphDb      = graphDbCommand.execute();
      ExecutionEngine engine            = (ExecutionEngine) new ExecutionEngine(graphDb);
     
      try (final Tx tx = app.tx()) {
       
        ExecutionResult result            = engine.execute("start n = node(*) match (n)<-[r:ONE_TO_ONE]-() return r");
        final Iterator<Relationship> rels = result.columnAs("r");

        assertTrue(rels.hasNext());

        rels.next().delete();
View Full Code Here

    return execute(query, parameters, includeHiddenAndDeleted, false);
  }
 
  public List<GraphObject> execute(String query, Map<String, Object> parameters, boolean includeHiddenAndDeleted, boolean publicOnly) throws FrameworkException {

    ExecutionEngine     engine      = (ExecutionEngine) arguments.get("cypherExecutionEngine");
    RelationshipFactory relFactory  = new RelationshipFactory(securityContext);
    NodeFactory nodeFactory         = new NodeFactory(securityContext);

    List<GraphObject> resultList = new LinkedList<>();
    ExecutionResult result       = null;

    if (parameters != null) {

      result = engine.execute(query, parameters);
     
    } else {
     
      result = engine.execute(query);
    }

    for (Map<String, Object> row : result) {

      GraphObjectMap dummyObject = null;
View Full Code Here

   
    this.handler = handler;
   
    try {
      graphDb = (GraphDatabaseService)StructrApp.getInstance().command(GraphDatabaseCommand.class).execute();
      engine  = new ExecutionEngine(graphDb);

    } catch(Throwable t) {
     
      logger.log(Level.WARNING, "Unable to create cypher execution engine.");
    }
View Full Code Here

    logger.log(Level.FINE, "Relationship numeric index ready.");
    logger.log(Level.FINE, "Initializing relationship factory...");

    logger.log(Level.FINE, "Relationship factory ready.");
    cypherExecutionEngine = new ExecutionEngine(graphDb);

    logger.log(Level.FINE, "Cypher execution engine ready.");

    isInitialized = true;
  }
View Full Code Here

  public static void importCypher(final List<String> sources) throws FrameworkException {

    final App app                      = StructrApp.getInstance();
    final GraphDatabaseService graphDb = app.command(GraphDatabaseCommand.class).execute();
    final ExecutionEngine engine       = new ExecutionEngine(graphDb, new BufferingLogger());

    // nothing to do
    if (sources.isEmpty()) {
      return;
    }

    // first step: execute cypher queries
    for (final String source : sources) {

      try {
        // be very tolerant here, just execute everything
        engine.execute(source);

      } catch (Throwable t) {
        // ignore
        t.printStackTrace();
      }
View Full Code Here

    private final ExecutionEngine executionEngine;

    public EmbeddedNeo4jDatastoreSession(GraphDatabaseService graphDatabaseService) {
        super(graphDatabaseService);
        datastoreTransaction = new EmbeddedNeo4jDatastoreTransaction();
        executionEngine = new ExecutionEngine(graphDatabaseService);
    }
View Full Code Here


    public EmbeddedNeo4jDatastoreSession(GraphDatabaseService graphDatabaseService) {
        super(graphDatabaseService);
        datastoreTransaction = new EmbeddedNeo4jDatastoreTransaction();
        executionEngine = new ExecutionEngine(graphDatabaseService);
    }
View Full Code Here

    private final DescriptorCache descriptorCache = new DescriptorCache();

    public DescriptorDAOImpl(DescriptorMapperRegistry registry, GraphDatabaseService database) {
        this.registry = registry;
        this.database = database;
        this.executionEngine = new ExecutionEngine(database);
    }
View Full Code Here

    }


    private void dumpDB() {
        ExecutionResult cypher = new ExecutionEngine(graphdb()).execute("MATCH (n)-[r]->() return n,type(r),r");
        System.out.println(cypher.dumpToString());
    }
View Full Code Here

TOP

Related Classes of org.neo4j.cypher.javacompat.ExecutionEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.