Spring Data Neo4j

org.springframework.data.neo4j.core
Interface GraphDatabase

All Known Implementing Classes:
DelegatingGraphDatabase, SpringRestGraphDatabase

public interface GraphDatabase


Method Summary
<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
<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> properties)
          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)
           
<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)
           
 boolean transactionIsRunning()
           
 org.neo4j.graphdb.traversal.TraversalDescription traversalDescription()
           
 

Method Detail

getReferenceNode

org.neo4j.graphdb.Node getReferenceNode()
Returns:
the reference node of the underlying graph database

getNodeById

org.neo4j.graphdb.Node getNodeById(long id)
Parameters:
id - node id
Returns:
the requested node of the underlying graph database
Throws:
org.neo4j.graphdb.NotFoundException

createNode

org.neo4j.graphdb.Node createNode(Map<String,Object> props)
creates the node and initializes its properties


getOrCreateNode

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


getRelationshipById

org.neo4j.graphdb.Relationship getRelationshipById(long id)
Parameters:
id - relationship id
Returns:
the requested relationship of the underlying graph database
Throws:
org.neo4j.graphdb.NotFoundException

createRelationship

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


getOrCreateRelationship

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. If the relationship for this combination already existed it is returned otherwise created and populated with the provided properties.


remove

void remove(org.neo4j.graphdb.Node node)
deletes the Node and its index entries


remove

void remove(org.neo4j.graphdb.Relationship relationship)
deletes the relationship and its index entries


getIndex

<T extends org.neo4j.graphdb.PropertyContainer> org.neo4j.graphdb.index.Index<T> getIndex(String indexName)
Parameters:
indexName - existing index name, not null
Returns:
existing index Index
Throws:
IllegalArgumentException - if the index doesn't exist

createIndex

<T extends org.neo4j.graphdb.PropertyContainer> org.neo4j.graphdb.index.Index<T> createIndex(Class<T> type,
                                                                                             String indexName,
                                                                                             IndexType indexType)
creates a index

Parameters:
type - type of index requested - either Node.class or Relationship.class
indexName, - not null
fullText - true if a fulltext queryable index is needed, false for exact match
Returns:
node index Index

traversalDescription

org.neo4j.graphdb.traversal.TraversalDescription traversalDescription()
Returns:
a TraversalDescription as starting point for defining a traversal

queryEngineFor

<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


queryEngineFor

<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


setConversionService

void setConversionService(ConversionService conversionService)
Parameters:
conversionService - the conversion service to be used for the default result converter of this database

setResultConverter

void setResultConverter(ResultConverter resultConverter)
Parameters:
resultConverter - the default result converter to be used with this database

transactionIsRunning

boolean transactionIsRunning()
Returns:
true if a transaction is currently running

Spring Data Neo4j

Copyright © 2012 SpringSource. All Rights Reserved.