@Override public Result execute( String query, Map<String,Object> parameters, long timeout, TimeUnit unit ) throws QueryExecutionException { return getGraphDatabaseAPI().execute( query, parameters, timeout, unit ); }
@Override public InternalTransaction beginTransaction( KernelTransaction.Type type, LoginContext loginContext ) { return getGraphDatabaseAPI().beginTransaction( type, loginContext ); }
@Override public InternalTransaction beginTransaction( KernelTransaction.Type type, LoginContext loginContext, long timeout, TimeUnit unit ) { return getGraphDatabaseAPI().beginTransaction( type, loginContext, timeout, unit ); }
@Override public Result execute( String query, long timeout, TimeUnit unit ) throws QueryExecutionException { return getGraphDatabaseAPI().execute( query, timeout, unit ); }
@Override public Transaction beginTx() { return getGraphDatabaseAPI().beginTx(); }
@Override public Result execute( String query, Map<String, Object> parameters ) throws QueryExecutionException { return getGraphDatabaseAPI().execute( query, parameters ); }
@Override public Transaction beginTx( long timeout, TimeUnit timeUnit ) { return getGraphDatabaseAPI().beginTx( timeout, timeUnit ); }
@Override public Node getNodeById( long id ) { return getGraphDatabaseAPI().getNodeById( id ); }
@Override public Schema schema() { return getGraphDatabaseAPI().schema(); }
public Transaction begin() { tx = database.getGraphDatabaseAPI().beginTx(); return tx; }
@Override public Node createNode( Label... labels ) { return getGraphDatabaseAPI().createNode( labels ); }
private void executeTransaction( Runnable runnable, boolean success ) { try ( Transaction tx = dbr.getGraphDatabaseAPI().beginTx() ) { runnable.run(); if ( success ) { tx.success(); } } }
public GraphDatabaseAPI restartDatabase( RestartAction action, String... configChanges ) throws IOException { FileSystemAbstraction fs = resolveDependency( FileSystemAbstraction.class ); database.shutdown(); action.run( fs, databaseLayout ); database = null; // This DatabaseBuilder has already been configured with the global settings as well as any test-specific settings, // so just apply these additional settings. databaseBuilder.setConfig( stringMap( configChanges ) ); return getGraphDatabaseAPI(); }
private NeoStores flipToNeoStores() { return dbRule.getGraphDatabaseAPI().getDependencyResolver().resolveDependency( RecordStorageEngine.class ).testAccessNeoStores(); }
/** Transactional version of {@link #countsForNode(Label)} */ private long numberOfNodesWith( Label label ) { try ( Transaction tx = db.getGraphDatabaseAPI().beginTx() ) { long nodeCount = countsForNode( label ); tx.success(); return nodeCount; } }
@Before public void before() { idGeneratorFactory = dbRule.getGraphDatabaseAPI().getDependencyResolver().resolveDependency( IdGeneratorFactory.class ); }
private void deleteNode( Node node ) { try ( Transaction tx = dbRule.getGraphDatabaseAPI().beginTx() ) { node.delete(); tx.success(); } }
@Before public void exposeGuts() { ktxSupplier = () -> db.getGraphDatabaseAPI().getDependencyResolver() .resolveDependency( ThreadToStatementContextBridge.class ) .getKernelTransactionBoundToThisThread( true ); }
@Test public void canAddMultipleShortStringsToTheSameNode() { Node node = graphdb.getGraphDatabaseAPI().createNode(); node.setProperty( "key", "value" ); node.setProperty( "reverse", "esrever" ); commit(); assertThat( node, inTx( graphdb.getGraphDatabaseAPI(), hasProperty( "key" ).withValue( "value" ) ) ); assertThat( node, inTx( graphdb.getGraphDatabaseAPI(), hasProperty( "reverse" ).withValue( "esrever" ) ) ); }
@Test public void canUpdateShortStringInplace() { Node node = graphdb.getGraphDatabaseAPI().createNode(); node.setProperty( "key", "value" ); newTx(); assertEquals( "value", node.getProperty( "key" ) ); node.setProperty( "key", "other" ); commit(); assertThat( node, inTx( graphdb.getGraphDatabaseAPI(), hasProperty( "key" ).withValue( "other" ) ) ); }