Package org.neo4j.kernel

Examples of org.neo4j.kernel.EmbeddedGraphDatabase.createNode()


        try
        {
            RelationshipIndex index = service.index().forRelationships( "exact" );
            // ...creation of the nodes and relationship
            Node node1 = service.createNode();
            Node node2 = service.createNode();
            String a_uuid = "xyz";
            Relationship relationship = node1.createRelationshipTo( node2, DynamicRelationshipType.withName( "related" ) );
            index.add( relationship, "uuid", a_uuid );
            // query
            IndexHits<Relationship> hits = index.get( "uuid", a_uuid, node1, node2 );
View Full Code Here


        GraphDatabaseService db = new EmbeddedGraphDatabase( args[0] );
        Index<Node> index = db.index().forNodes( "index" );
        Transaction tx = db.beginTx();
        try
        {
            Node node = db.createNode();
            index.add( node, "key", "value" );
            index.delete();
            tx.success();
        }
        finally
View Full Code Here

        String path = args[0];
        String indexName = "myIndex";
        GraphDatabaseService db = new EmbeddedGraphDatabase( path );
        Index<Relationship> index = db.index().forRelationships( indexName );
        Transaction tx = db.beginTx();
        Node node = db.createNode();
        Relationship relationship = db.getReferenceNode().createRelationshipTo( node, DynamicRelationshipType.withName( "KNOWS" ) );
        index.add( relationship, "key", "value" );
        tx.success();
        tx.finish();
        // Skip shutdown
View Full Code Here

        config.put( "relationship_grab_size", "1" );
        String storePath = getStorePath( "neo2" );
        deleteFileOrDirectory( storePath );
        EmbeddedGraphDatabase graphDb = new EmbeddedGraphDatabase( storePath, config );
        Transaction tx = graphDb.beginTx();
        Node node1 = graphDb.createNode();
        Node node2 = graphDb.createNode();
        node1.createRelationshipTo( node2, MyRelTypes.TEST );
        node2.createRelationshipTo( node1, MyRelTypes.TEST2 );
        node1.createRelationshipTo( node2, MyRelTypes.TEST_TRAVERSAL );
        tx.success();
View Full Code Here

        String storePath = getStorePath( "neo2" );
        deleteFileOrDirectory( storePath );
        EmbeddedGraphDatabase graphDb = new EmbeddedGraphDatabase( storePath, config );
        Transaction tx = graphDb.beginTx();
        Node node1 = graphDb.createNode();
        Node node2 = graphDb.createNode();
        node1.createRelationshipTo( node2, MyRelTypes.TEST );
        node2.createRelationshipTo( node1, MyRelTypes.TEST2 );
        node1.createRelationshipTo( node2, MyRelTypes.TEST_TRAVERSAL );
        tx.success();
        tx.finish();
View Full Code Here

              for ( int i = 0; i < 100; i++ )
              {
                                String key = keys[i%keys.length];
                                String value = values[i%values.length]+i;
                               
                Node node = db.createNode();
                                node.setProperty( key, value );
                index.add( node, key, value );
              }
              tx.success();
            }
View Full Code Here

    
        org.neo4j.graphdb.Transaction gdbTx = graphDb.beginTx();
        TransactionManager txMgr = graphDb.getConfig().getTxModule().getTxManager();
        Transaction tx = txMgr.getTransaction();
       
        graphDb.createNode();
        tx.enlistResource( noob.getXaConnection().getXaResource() );
        try
        {
            gdbTx.success();
            gdbTx.finish();
View Full Code Here

    public void testDatabaseLocking()
    {
        assumeTrue( Config.osIsWindows() );
        EmbeddedGraphDatabase db = new EmbeddedGraphDatabase( path );
        Transaction tx = db.beginTx();
        db.createNode();
        tx.success();
        tx.finish();
        assertTrue( new File( path + "\\lock" ).exists() );
        try
        {
View Full Code Here

        String storePath = getStorePath( "test-neo2" );
        deleteFileOrDirectory( storePath );
        GraphDatabaseService graphDb2 = new EmbeddedGraphDatabase( storePath );
        Transaction tx2 = graphDb2.beginTx();
        getGraphDb().createNode();
        graphDb2.createNode();
        tx2.success();
        tx2.finish();
        graphDb2.shutdown();
    }
   
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.