Search in sources :

Example 1 with EmbeddedGraphDatabase

use of org.neo4j.kernel.internal.EmbeddedGraphDatabase in project neo4j by neo4j.

the class ProduceUncleanStore method main.

public static void main(String[] args) throws Exception {
    String storeDir = args[0];
    boolean setGraphProperty = args.length > 1 ? Boolean.parseBoolean(args[1]) : false;
    GraphDatabaseService db = new EmbeddedGraphDatabase(storeDir, stringMap(), GraphDatabaseDependencies.newDependencies().userLogProvider(NullLogProvider.getInstance()));
    try (Transaction tx = db.beginTx()) {
        Node node = db.createNode();
        node.setProperty("name", "Something");
        if (setGraphProperty) {
            //noinspection deprecation
            ((GraphDatabaseAPI) db).getDependencyResolver().resolveDependency(NodeManager.class).newGraphProperties().setProperty("prop", "Some value");
        }
        tx.success();
    }
    System.exit(0);
}
Also used : EmbeddedGraphDatabase(org.neo4j.kernel.internal.EmbeddedGraphDatabase) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) Transaction(org.neo4j.graphdb.Transaction) Node(org.neo4j.graphdb.Node)

Aggregations

GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)1 Node (org.neo4j.graphdb.Node)1 Transaction (org.neo4j.graphdb.Transaction)1 EmbeddedGraphDatabase (org.neo4j.kernel.internal.EmbeddedGraphDatabase)1