|
Spring Data Graph | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Neo4jOperations
A template with convenience operations, exception translation and implicit transaction for modifying methods
Method Summary | ||
---|---|---|
org.neo4j.graphdb.Node |
createNode(Property... props)
Transactionally creates the node, sets the properties (if any) and indexes the given fields (if any). |
|
org.neo4j.graphdb.Relationship |
createRelationship(org.neo4j.graphdb.Node startNode,
org.neo4j.graphdb.Node endNode,
org.neo4j.graphdb.RelationshipType type,
Property... 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) template.createRelationship(from,to,TYPE, Property. |
|
|
exec(GraphCallback<T> callback)
Executes the callback in a NON-transactional context. |
|
org.neo4j.graphdb.Node |
getNode(long id)
Delegates to the GraphDatabase |
|
org.neo4j.graphdb.Node |
getReferenceNode()
Delegates to the GraphDatabase |
|
org.neo4j.graphdb.Relationship |
getRelationship(long id)
Delegates to the GraphDatabase |
|
|
index(String indexName,
T element,
String field,
Object value)
Indexes the given field and value for the element. |
|
|
query(String indexName,
PathMapper<T> pathMapper,
Object queryOrQueryObject)
Queries the supplied index with a lucene query string or query object (if the neo4j-index provider is lucene) |
|
|
query(String indexName,
PathMapper<T> pathMapper,
String field,
String value)
Queries the supplied index with a field - value combination |
|
|
traverseGraph(org.neo4j.graphdb.Node startNode,
PathMapper<T> pathMapper,
org.neo4j.graphdb.traversal.TraversalDescription traversal)
Traverses the whole path with the given traversal descripting starting at the start node. |
|
|
traverseNext(org.neo4j.graphdb.Node startNode,
PathMapper<T> pathMapper)
Traverses only to all direct neighbours of the start node for all relationships |
|
|
traverseNext(org.neo4j.graphdb.Node startNode,
PathMapper<T> pathMapper,
org.neo4j.graphdb.RelationshipType... types)
Traverses only to the direct neighbours of the start node for the specified relationship types |
|
|
traverseNext(org.neo4j.graphdb.Node startNode,
PathMapper<T> pathMapper,
org.neo4j.graphdb.RelationshipType type,
org.neo4j.graphdb.Direction direction)
Traverses only to the direct neighbours of the start node |
Method Detail |
---|
<T> T exec(GraphCallback<T> callback)
T
- return typecallback
- for executing graph operations NON-transactionally, not null
DataAccessException
- subclassesorg.neo4j.graphdb.Node getReferenceNode()
org.neo4j.graphdb.Node getNode(long id)
id
- node id
org.neo4j.graphdb.NotFoundException
org.neo4j.graphdb.Node createNode(Property... props)
template.createNode(Property._("name","value"));
template.createNode(Property._("name","value","prop","anotherValue"));
props
- properties to be set at node creation might be null
org.neo4j.graphdb.Relationship getRelationship(long id)
id
- relationship id
org.neo4j.graphdb.NotFoundException
org.neo4j.graphdb.Relationship createRelationship(org.neo4j.graphdb.Node startNode, org.neo4j.graphdb.Node endNode, org.neo4j.graphdb.RelationshipType type, Property... props)
template.createRelationship(from,to,TYPE, Property._("name","value"));
template.createRelationship(from,to,TYPE, Property._("name","value","prop","anotherValue"));
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
<T> org.neo4j.helpers.collection.ClosableIterable<T> query(String indexName, PathMapper<T> pathMapper, Object queryOrQueryObject)
indexName
- Name of the index, will be checked against existing indexes, first relationship-indexes, then node indexes
assumes a "node" node index for a null valuepathMapper
- a mapper that translates from the resulting paths into some domain object, might use PathMapper.WithoutResult for a callback behaviourqueryOrQueryObject
- a lucene query string or query object (if the neo4j-index provider is lucene)
for controlling eagerness of iteration
<T> org.neo4j.helpers.collection.ClosableIterable<T> query(String indexName, PathMapper<T> pathMapper, String field, String value)
indexName
- Name of the index, will be checked against existing indexes, first relationship-indexes, then node indexes
assumes a "node" node index for a null valuepathMapper
- a mapper that translates from the resulting paths into some domain object, might use PathMapper.WithoutResult for a callback behaviourfield
- field to queryvalue
- value to supply to index query
for controlling eagerness of iteration
<T> Iterable<T> traverseGraph(org.neo4j.graphdb.Node startNode, PathMapper<T> pathMapper, org.neo4j.graphdb.traversal.TraversalDescription traversal)
T
- expected type of resultstartNode
- start node for the traversalpathMapper
- pathMapper a mapper that translates from the resulting paths into some domain object, might use PathMapper.WithoutResult for a callback behaviourtraversal
- a traversal description, possibly generated by the Traversal.description()... DSL
<T> Iterable<T> traverseNext(org.neo4j.graphdb.Node startNode, PathMapper<T> pathMapper, org.neo4j.graphdb.RelationshipType type, org.neo4j.graphdb.Direction direction)
T
- expected type of resultstartNode
- start node for the traversalpathMapper
- pathMapper a mapper that translates from the resulting paths into some domain object, might use PathMapper.WithoutResult for a callback behaviourtype
- type of relationships to considerdirection
- direction of relationship to consider (can be OUTGOING, INCOMING, BOTH)
<T> Iterable<T> traverseNext(org.neo4j.graphdb.Node startNode, PathMapper<T> pathMapper, org.neo4j.graphdb.RelationshipType... types)
T
- expected type of resultstartNode
- start node for the traversalpathMapper
- pathMapper a mapper that translates from the resulting paths into some domain object, might use PathMapper.WithoutResult for a callback behaviourtypes
- types of relationships to consider
<T> Iterable<T> traverseNext(org.neo4j.graphdb.Node startNode, PathMapper<T> pathMapper)
T
- expected type of resultstartNode
- start node for the traversalpathMapper
- pathMapper a mapper that translates from the resulting paths into some domain object, might use PathMapper.WithoutResult for a callback behaviour
<T extends org.neo4j.graphdb.PropertyContainer> T index(String indexName, T element, String field, Object value)
T
- the provided element typeindexName
- Name of the index, will be checked against existing indexes according to the given element
assumes a "node" node index or "relationship" relationship index for a null valueelement
- node or relationship to indexfield
- field to indexvalue
- value to index
|
Spring Data Graph | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |