Interface Neo4JTemplate
- All Superinterfaces:
org.eclipse.jnosql.mapping.graph.GraphTemplate,org.eclipse.jnosql.mapping.semistructured.SemiStructuredTemplate,jakarta.nosql.Template
public interface Neo4JTemplate
extends org.eclipse.jnosql.mapping.graph.GraphTemplate
A template interface for executing queries, traversing relationships,
and managing edges in a Neo4J database.
This interface provides methods for executing Cypher queries,
traversing relationships, and handling edges between entities.
-
Method Summary
Modifier and TypeMethodDescription<T> Stream<T>Executes a Cypher query and returns a stream of results mapped to the given entity type.<T> Stream<T>Executes a Cypher query and returns a stream of results mapped to the given entity type.<T> Stream<T>Traverses relationships from a given start node up to a specified depth.<T> Stream<T>Traverses relationships dynamically using a relationship supplier.Methods inherited from interface org.eclipse.jnosql.mapping.graph.GraphTemplate
delete, deleteEdge, edge, edge, edge, findEdgeByIdMethods inherited from interface org.eclipse.jnosql.mapping.semistructured.SemiStructuredTemplate
count, count, count, delete, deleteAll, exists, findAll, prepare, prepare, query, query, select, selectCursor, selectOffSet, singleResult, singleResult, singleResultMethods inherited from interface jakarta.nosql.Template
delete, delete, find, insert, insert, insert, insert, select, update, update
-
Method Details
-
cypher
Executes a Cypher query and returns a stream of results mapped to the given entity type.- Type Parameters:
T- The entity type representing nodes or relationships within the graph database.- Parameters:
cypher- The Cypher query string.parameters- The query parameters.- Returns:
- A stream of entities representing the query result.
- Throws:
NullPointerException- ifcypherorparametersis null.
-
cypher
Executes a Cypher query and returns a stream of results mapped to the given entity type.- Type Parameters:
T- The entity type representing nodes or relationships within the graph database.- Parameters:
cypher- The Cypher query string.- Returns:
- A stream of entities representing the query result.
- Throws:
NullPointerException- ifcypheris null.
-
traverse
Traverses relationships from a given start node up to a specified depth.- Type Parameters:
T- The entity type representing nodes or relationships within the graph database.- Parameters:
startNodeId- The unique identifier of the starting node.relationship- The relationship type to traverse.depth- The depth of traversal.- Returns:
- A stream of entities resulting from the traversal.
- Throws:
NullPointerException- ifstartNodeIdorrelationshipis null.
-
traverse
Traverses relationships dynamically using a relationship supplier.- Type Parameters:
T- The entity type representing nodes or relationships within the graph database.- Parameters:
startNodeId- The unique identifier of the starting node.relationship- A supplier providing the relationship type dynamically.depth- The depth of traversal.- Returns:
- A stream of entities resulting from the traversal.
- Throws:
NullPointerException- ifstartNodeIdorrelationshipis null.
-