Package com.tinkerpop.blueprints.impls.orient

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraph.commit()


  private void setupClasses() {
    OrientGraph db = new OrientGraph("memory:temp", "admin", "admin");
    db.createVertexType("rawCategory");
    db.createVertexType("rawField");
    db.commit();
    db.shutdown();
  }

  private void populateDatabase() {
    OrientGraph db = new OrientGraph("memory:temp", "admin", "admin");
View Full Code Here


    asubVertex.setProperty("name", "asub");
    bsubVertex = db.addVertex("class:rawField");
    bsubVertex.setProperty("name", "bsub");
    asubVertex.addEdge("hasParent", aVertex);
    bsubVertex.addEdge("hasParent", bVertex);
    db.commit();
    db.shutdown();
  }

  private void tryLabelQuery() {
    OrientGraph db = new OrientGraph("memory:temp", "admin", "admin");
View Full Code Here

    else {
      for (Vertex rc : rcs) {
        System.out.println("GOT RC: " + rc);
      }
    }
    db.commit();
    db.shutdown();
  }

  private void runEdgeTest() {
    reparent(asubVertex, bVertex);
View Full Code Here

    // get vertex again
    childVertex = db.getVertex(childVertex.getId());
    Vertex parentVertex = db.getVertex(parent.getId());
    // add new edge to b
    childVertex.addEdge("hasParent", parentVertex);
    db.commit();
  }
}
View Full Code Here

      vertexOne.addEdge("getEdgesUpdateEdge", vertexTwo);
      vertexOne.addEdge("getEdgesUpdateEdge", vertexThree);
      vertexOne.addEdge("getEdgesUpdateEdge", vertexFour);

      g.commit();

      Iterable<Edge> iterable = vertexOne.getEdges(Direction.OUT, "getEdgesUpdateEdge");
      Iterator<Edge> iterator = iterable.iterator();

      int counter = 0;
View Full Code Here

      Edge deleteEdge = (Edge) iterator.next();

      Vertex deleteVertex = deleteEdge.getVertex(Direction.IN);
      deleteVertex.remove();

      g.commit();

      iterable = vertexOne.getEdges(Direction.OUT, "getEdgesUpdateEdge");
      iterator = iterable.iterator();

      counter = 0;
View Full Code Here

      // Step 1
      // Create several foo's
      graph.addVertex("class:Foo", "address", "test1");
      graph.addVertex("class:Foo", "address", "test2");
      graph.addVertex("class:Foo", "address", "test3");
      graph.commit();

      // just show what is there
      List<ODocument> result = graph.getRawGraph().query(new OSQLSynchQuery<ODocument>("select * from Foo"));

      for (ODocument d : result) {
View Full Code Here

      Assert.assertEquals(result.size(), 1);
      // Step 4c
      graph.removeVertex(graph.getVertex(result.get(0)));

      // Step 6
      graph.commit();

      // just show what is there
      result = graph.getRawGraph().query(new OSQLSynchQuery<ODocument>("select * from Foo"));

      for (ODocument d : result) {
View Full Code Here

      // Comment out these two lines and the test will succeed. The issue appears to be related to an edge
      // connecting a deleted vertex during a transaction
      ODocument bar = graph.addVertex("class:Bar", "prop", "test1").getRecord();
      ODocument sees = graph.addEdge(null, graph.getVertex(foo), graph.getVertex(bar), "Sees").getRecord();
      graph.commit();

      List<ODocument> foos = graph.getRawGraph().query(new OSQLSynchQuery("select * from Foo"));
      Assert.assertEquals(foos.size(), 1);

      graph.removeVertex(graph.getVertex(foos.get(0)));
View Full Code Here

        List<OIdentifiable> result = graph.getRawGraph().query(
            new OSQLSynchQuery<Object>("select from V where purpose = 'testQueryIsolation'"));
        Assert.assertEquals(result.size(), 1);
      }

      graph.commit();

      List<OIdentifiable> result = graph.getRawGraph().query(
          new OSQLSynchQuery<Object>("select from V where purpose = 'testQueryIsolation'"));
      Assert.assertEquals(result.size(), 1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.