Пример #1
0
 private void createDbIfNecessary() {
   if (!new File(storeDir, "neostore").exists()) {
     db = new GraphDatabaseFactory().newEmbeddedDatabase(storeDir.getPath());
     BatchTransaction tx = beginBatchTx(db);
     try {
       Node node = db.createNode();
       createRelationships(tx, node, MyRelTypes.TEST, INCOMING, 1);
       createRelationships(tx, node, MyRelTypes.TEST, OUTGOING, 3_000_000);
       createRelationships(tx, node, MyRelTypes.TEST2, OUTGOING, 5);
       createRelationships(tx, node, MyRelTypes.TEST2, BOTH, 5);
       createRelationships(tx, node, MyRelTypes.TEST_TRAVERSAL, OUTGOING, 2_000_000);
       createRelationships(tx, node, MyRelTypes.TEST_TRAVERSAL, INCOMING, 2);
     } finally {
       tx.close();
       db.shutdown();
     }
   }
 }