Package org.neo4j.graphdb

Examples of org.neo4j.graphdb.GraphDatabaseService.beginTx()


  @Nonnull
  private T deserialize( @Nonnull AbstractNeo4jSerializer<T> serializer, @Nonnull String serialized ) throws IOException {
    GraphDatabaseService db = neo4jRule.createDb();

    //Fill the db initially
    try ( Transaction tx = db.beginTx() ) {
      ExecutionResult result = new ExecutionEngine( db ).execute( serialized );
      tx.success();
    }

    try ( Transaction tx = db.beginTx() ) {
View Full Code Here


    try ( Transaction tx = db.beginTx() ) {
      ExecutionResult result = new ExecutionEngine( db ).execute( serialized );
      tx.success();
    }

    try ( Transaction tx = db.beginTx() ) {
      return serializer.deserialize( db.getNodeById( 0 ) );
    }
  }

  @Nonnull
View Full Code Here

  @Nonnull
  protected String serialize( @Nonnull Serializer<T, Node, Node> serializer, @Nonnull T objectToSerialize ) throws IOException {
    GraphDatabaseService db = neo4jRule.createDb();

    try ( Transaction tx = db.beginTx() ) {
      Node rootNode = db.createNode();
      serializer.serialize( objectToSerialize, rootNode );

      tx.success();
    }
View Full Code Here

      tx.success();
    }

    //Creates the cyper representation for this database
    StringWriter out = new StringWriter();
    try ( Transaction tx = db.beginTx() ) {
      final SubGraph graph = DatabaseSubGraph.from( db );
      new SubGraphExporter( graph ).export( new PrintWriter( out ) );
      tx.success();
    }
    return out.toString();
View Full Code Here

  public static void main(String[] args) {
    System.out.println("Hello Neo4j!");
//    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "target/data/test" );
    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "/Users/trisberg/neo4j/imdb" );
    Transaction tx = graphDb.beginTx();

    tx = graphDb.beginTx();
    try {
      for (Node n : graphDb.getAllNodes()) {
        System.out.print("=> " + n.getId() + " :: ");
View Full Code Here

    System.out.println("Hello Neo4j!");
//    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "target/data/test" );
    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "/Users/trisberg/neo4j/imdb" );
    Transaction tx = graphDb.beginTx();

    tx = graphDb.beginTx();
    try {
      for (Node n : graphDb.getAllNodes()) {
        System.out.print("=> " + n.getId() + " :: ");
        for (String s : n.getPropertyKeys()) {
          System.out.print(" : " + s + " = " + n.getProperty(s));
View Full Code Here

    private void populateDb() throws DatabaseBlockedException
    {
        GraphDatabaseService db = DatabaseLocator.getGraphDatabase();

        Transaction tx = db.beginTx();
        try
        {
            Node n = db.getNodeById( 0l );
            n.setProperty( POPULATED_KEY, POPULATED_VALUE );
            tx.success();
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.