Spring Data Neo4j

org.springframework.data.neo4j.support
Class DelegatingGraphDatabase

java.lang.Object
  extended by org.springframework.data.neo4j.support.DelegatingGraphDatabase
All Implemented Interfaces:
GraphDatabase

public class DelegatingGraphDatabase
extends Object
implements GraphDatabase

Since:
29.03.11
Author:
mh

Field Summary
protected  org.neo4j.graphdb.GraphDatabaseService delegate
           
 
Constructor Summary
DelegatingGraphDatabase(org.neo4j.graphdb.GraphDatabaseService delegate)
           
DelegatingGraphDatabase(org.neo4j.graphdb.GraphDatabaseService delegate, ResultConverter resultConverter)
           
 
Method Summary
 org.neo4j.graphdb.Transaction beginTx()
           
<T extends org.neo4j.graphdb.PropertyContainer>
org.neo4j.graphdb.index.Index<T>
createIndex(Class<T> type, String indexName, IndexType indexType)
          creates a index
 org.neo4j.graphdb.Node createNode(Map<String,Object> props)
          creates the node and initializes its properties
 org.neo4j.graphdb.Relationship createRelationship(org.neo4j.graphdb.Node startNode, org.neo4j.graphdb.Node endNode, org.neo4j.graphdb.RelationshipType type, Map<String,Object> properties)
          creates the relationship between the startNode, endNode with the given type which will be populated with the provided properties
 org.neo4j.graphdb.GraphDatabaseService getGraphDatabaseService()
           
<T extends org.neo4j.graphdb.PropertyContainer>
org.neo4j.graphdb.index.Index<T>
getIndex(String indexName)
           
 org.neo4j.graphdb.Node getNodeById(long id)
           
 org.neo4j.graphdb.Node getOrCreateNode(String indexName, String key, Object value, Map<String,Object> nodeProperties)
          creates the node uniquely or returns an existing node with the same index-key-value combination.
 org.neo4j.graphdb.Relationship getOrCreateRelationship(String indexName, String key, Object value, org.neo4j.graphdb.Node startNode, org.neo4j.graphdb.Node endNode, String type, Map<String,Object> properties)
          Creates the relationship uniquely, uses the given index,key,value to achieve that.
 org.neo4j.graphdb.Node getReferenceNode()
           
 org.neo4j.graphdb.Relationship getRelationshipById(long id)
           
 TransactionManager getTransactionManager()
           
 boolean isNode(Class<? extends org.neo4j.graphdb.PropertyContainer> type)
           
<T> QueryEngine<T>
queryEngineFor(QueryType type)
          returns a query engine for the provided type (Cypher or Gremlin) which is initialized with the default result converter
<T> QueryEngine<T>
queryEngineFor(QueryType type, ResultConverter resultConverter)
          returns a query engine for the provided type (Cypher or Gremlin) which is initialized with the provided result converter
 void remove(org.neo4j.graphdb.Node node)
          deletes the Node and its index entries
 void remove(org.neo4j.graphdb.Relationship relationship)
          deletes the relationship and its index entries
 void setConversionService(ConversionService conversionService)
           
 void setResultConverter(ResultConverter resultConverter)
           
 void shutdown()
           
 boolean transactionIsRunning()
           
 org.neo4j.graphdb.traversal.TraversalDescription traversalDescription()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected org.neo4j.graphdb.GraphDatabaseService delegate
Constructor Detail

DelegatingGraphDatabase

public DelegatingGraphDatabase(org.neo4j.graphdb.GraphDatabaseService delegate)

DelegatingGraphDatabase

public DelegatingGraphDatabase(org.neo4j.graphdb.GraphDatabaseService delegate,
                               ResultConverter resultConverter)
Method Detail

setConversionService

public void setConversionService(ConversionService conversionService)
Specified by:
setConversionService in interface GraphDatabase
Parameters:
conversionService - the conversion service to be used for the default result converter of this database

setResultConverter

public void setResultConverter(ResultConverter resultConverter)
Specified by:
setResultConverter in interface GraphDatabase
Parameters:
resultConverter - the default result converter to be used with this database

getNodeById

public org.neo4j.graphdb.Node getNodeById(long id)
Specified by:
getNodeById in interface GraphDatabase
Parameters:
id - node id
Returns:
the requested node of the underlying graph database

createNode

public org.neo4j.graphdb.Node createNode(Map<String,Object> props)
Description copied from interface: GraphDatabase
creates the node and initializes its properties

Specified by:
createNode in interface GraphDatabase

getRelationshipById

public org.neo4j.graphdb.Relationship getRelationshipById(long id)
Specified by:
getRelationshipById in interface GraphDatabase
Parameters:
id - relationship id
Returns:
the requested relationship of the underlying graph database

createRelationship

public org.neo4j.graphdb.Relationship createRelationship(org.neo4j.graphdb.Node startNode,
                                                         org.neo4j.graphdb.Node endNode,
                                                         org.neo4j.graphdb.RelationshipType type,
                                                         Map<String,Object> properties)
Description copied from interface: GraphDatabase
creates the relationship between the startNode, endNode with the given type which will be populated with the provided properties

Specified by:
createRelationship in interface GraphDatabase

getIndex

public <T extends org.neo4j.graphdb.PropertyContainer> org.neo4j.graphdb.index.Index<T> getIndex(String indexName)
Specified by:
getIndex in interface GraphDatabase
Parameters:
indexName - existing index name, not null
Returns:
existing index Index

createIndex

public <T extends org.neo4j.graphdb.PropertyContainer> org.neo4j.graphdb.index.Index<T> createIndex(Class<T> type,
                                                                                                    String indexName,
                                                                                                    IndexType indexType)
Description copied from interface: GraphDatabase
creates a index

Specified by:
createIndex in interface GraphDatabase
Parameters:
type - type of index requested - either Node.class or Relationship.class
indexType - SIMPLE, FULLTEXT or POINT declaring the requested index-type
Returns:
node index Index

isNode

public boolean isNode(Class<? extends org.neo4j.graphdb.PropertyContainer> type)

traversalDescription

public org.neo4j.graphdb.traversal.TraversalDescription traversalDescription()
Specified by:
traversalDescription in interface GraphDatabase
Returns:
a TraversalDescription as starting point for defining a traversal

queryEngineFor

public <T> QueryEngine<T> queryEngineFor(QueryType type)
Description copied from interface: GraphDatabase
returns a query engine for the provided type (Cypher or Gremlin) which is initialized with the default result converter

Specified by:
queryEngineFor in interface GraphDatabase

queryEngineFor

public <T> QueryEngine<T> queryEngineFor(QueryType type,
                                         ResultConverter resultConverter)
Description copied from interface: GraphDatabase
returns a query engine for the provided type (Cypher or Gremlin) which is initialized with the provided result converter

Specified by:
queryEngineFor in interface GraphDatabase

transactionIsRunning

public boolean transactionIsRunning()
Specified by:
transactionIsRunning in interface GraphDatabase
Returns:
true if a transaction is currently running

getTransactionManager

public TransactionManager getTransactionManager()
Specified by:
getTransactionManager in interface GraphDatabase

beginTx

public org.neo4j.graphdb.Transaction beginTx()
Specified by:
beginTx in interface GraphDatabase

remove

public void remove(org.neo4j.graphdb.Node node)
Description copied from interface: GraphDatabase
deletes the Node and its index entries

Specified by:
remove in interface GraphDatabase

remove

public void remove(org.neo4j.graphdb.Relationship relationship)
Description copied from interface: GraphDatabase
deletes the relationship and its index entries

Specified by:
remove in interface GraphDatabase

shutdown

public void shutdown()

getReferenceNode

public org.neo4j.graphdb.Node getReferenceNode()
Specified by:
getReferenceNode in interface GraphDatabase
Returns:
the reference node of the underlying graph database

getGraphDatabaseService

public org.neo4j.graphdb.GraphDatabaseService getGraphDatabaseService()

getOrCreateNode

public org.neo4j.graphdb.Node getOrCreateNode(String indexName,
                                              String key,
                                              Object value,
                                              Map<String,Object> nodeProperties)
Description copied from interface: GraphDatabase
creates the node uniquely or returns an existing node with the same index-key-value combination. properties are used to initialize the node.

Specified by:
getOrCreateNode in interface GraphDatabase

getOrCreateRelationship

public org.neo4j.graphdb.Relationship getOrCreateRelationship(String indexName,
                                                              String key,
                                                              Object value,
                                                              org.neo4j.graphdb.Node startNode,
                                                              org.neo4j.graphdb.Node endNode,
                                                              String type,
                                                              Map<String,Object> properties)
Description copied from interface: GraphDatabase
Creates the relationship uniquely, uses the given index,key,value to achieve that. If the relationship for this combination already existed it is returned otherwise created and populated with the provided properties.

Specified by:
getOrCreateRelationship in interface GraphDatabase

Spring Data Neo4j

Copyright © 2013 SpringSource. All Rights Reserved.