org.springframework.data.neo4j.support
Class DelegatingGraphDatabase
java.lang.Object
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
|
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)
|
boolean |
isNode(Class<? extends org.neo4j.graphdb.PropertyContainer> type)
|
|
queryEngineFor(QueryType type)
|
void |
setConversionService(ConversionService conversionService)
|
void |
shutdown()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
delegate
protected org.neo4j.graphdb.GraphDatabaseService delegate
DelegatingGraphDatabase
public DelegatingGraphDatabase(org.neo4j.graphdb.GraphDatabaseService delegate)
setConversionService
public void setConversionService(ConversionService conversionService)
- Specified by:
setConversionService
in interface GraphDatabase
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
- 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");
- Specified by:
createNode
in interface GraphDatabase
- Parameters:
props
- properties to be set at node creation might be null
- Returns:
- the newly created node
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> props)
- Description copied from interface:
GraphDatabase
- 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");
- Specified by:
createRelationship
in interface GraphDatabase
- Parameters:
startNode
- start-node of relationshipendNode
- end-node of relationshiptype
- relationship type, might by an enum implementing RelationshipType or a DynamicRelationshipType.withName("name")props
- optional initial properties
- Returns:
- the newly created relationship
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,
boolean fullText)
- 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.classfullText
- true if a fulltext queryable index is needed, false for exact match
- Returns:
- node index
Index
isNode
public boolean isNode(Class<? extends org.neo4j.graphdb.PropertyContainer> type)
createTraversalDescription
public org.neo4j.graphdb.traversal.TraversalDescription createTraversalDescription()
- Specified by:
createTraversalDescription
in interface GraphDatabase
- Returns:
- a TraversalDescription as starting point for defining a traversal
queryEngineFor
public <T> QueryEngine<T> queryEngineFor(QueryType type)
- Specified by:
queryEngineFor
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
Copyright © 2011 SpringSource. All Rights Reserved.