Spring Data Graph

org.springframework.data.neo4j.core
Interface GraphDatabase

All Known Implementing Classes:
DelegatingGraphDatabase, RestGraphDatabase

public interface GraphDatabase


Method Summary
<T extends org.neo4j.graphdb.PropertyContainer>
org.neo4j.graphdb.index.Index<T>
createIndex(Class<T> type, String indexName, boolean fullText)
          creates a index
 org.neo4j.graphdb.Node createNode(Map<String,Object> props)
          Transactionally creates the node, sets the properties (if any).
 org.neo4j.graphdb.Relationship createRelationship(org.neo4j.graphdb.Node startNode, org.neo4j.graphdb.Node endNode, org.neo4j.graphdb.RelationshipType type, Map<String,Object> props)
          Transactionally creates the relationship, sets the properties (if any) and indexes the given fielss (if any) Two shortcut means of providing the properties (very short with static imports) graphDatabase.createRelationship(from,to,TYPE, PropertyMap.
 org.neo4j.graphdb.traversal.TraversalDescription createTraversalDescription()
           
<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 getReferenceNode()
           
 org.neo4j.graphdb.Relationship getRelationshipById(long id)
           
<T> QueryEngine<T>
queryEngineFor(QueryType type)
           
 void setConversionService(ConversionService conversionService)
           
 

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)
Transactionally creates the node, sets the properties (if any). Two shortcut means of providing the properties (very short with static imports) graphDatabase.createNode(PropertyMap._("name","value")); graphDatabase.createNode(PropertyMap.props().set("name","value").set("prop","anotherValue").toMap(), "name", "prop");

Parameters:
props - properties to be set at node creation might be null
Returns:
the newly created 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> props)
Transactionally creates the relationship, sets the properties (if any) and indexes the given fielss (if any) Two shortcut means of providing the properties (very short with static imports) graphDatabase.createRelationship(from,to,TYPE, PropertyMap._("name","value")); graphDatabase.createRelationship(from,to,TYPE, PropertyMap.props().set("name","value").set("prop","anotherValue").toMap(), "name", "prop");

Parameters:
startNode - start-node of relationship
endNode - end-node of relationship
type - relationship type, might by an enum implementing RelationshipType or a DynamicRelationshipType.withName("name")
props - optional initial properties
Returns:
the newly created relationship

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,
                                                                                             boolean fullText)
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

createTraversalDescription

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

queryEngineFor

<T> QueryEngine<T> queryEngineFor(QueryType type)

setConversionService

void setConversionService(ConversionService conversionService)

Spring Data Graph

Copyright © 2011 SpringSource. All Rights Reserved.