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 Type
    Method
    Description
    <T> Stream<T>
    cypher(String cypher)
    Executes a Cypher query and returns a stream of results mapped to the given entity type.
    <T> Stream<T>
    cypher(String cypher, Map<String,Object> parameters)
    Executes a Cypher query and returns a stream of results mapped to the given entity type.
    <T> Stream<T>
    traverse(String startNodeId, String relationship, int depth)
    Traverses relationships from a given start node up to a specified depth.
    <T> Stream<T>
    traverse(String startNodeId, Supplier<String> relationship, int depth)
    Traverses relationships dynamically using a relationship supplier.

    Methods inherited from interface org.eclipse.jnosql.mapping.graph.GraphTemplate

    delete, deleteEdge, edge, edge, edge, findEdgeById

    Methods 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, singleResult

    Methods inherited from interface jakarta.nosql.Template

    delete, delete, find, insert, insert, insert, insert, select, update, update
  • Method Details

    • cypher

      <T> Stream<T> cypher(String cypher, Map<String,Object> parameters)
      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 - if cypher or parameters is null.
    • cypher

      <T> Stream<T> cypher(String 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 - if cypher is null.
    • traverse

      <T> Stream<T> traverse(String startNodeId, String relationship, int depth)
      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 - if startNodeId or relationship is null.
    • traverse

      <T> Stream<T> traverse(String startNodeId, Supplier<String> relationship, int depth)
      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 - if startNodeId or relationship is null.