Interface Neo4jRepository<S,​ID>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void deleteAll()
      Deletes all science.neo4j.nodes in neo4j that are of type S
      Iterable<S> findAll()
      Returns all node in neo4j that are of type S
      default Stream<S> findAllAsStream()
      Returns all nodes as stream of type S
      S findById​(ID id)
      Returns the node with the given id, or null if no such node exists
      S findSubtree​(ID id)
      Returns the entire subtree of the node with the given id, or null if no such node exists
      S findSubtree​(ID id, int depth)
      Returns the entire subtree of the node with the given id, or null if no such node exists
      S findSubtree​(ID id, int depth, List<String> relationships)
      Returns the entire subtree of the node with the given id, or null if no such node exists
      <T extends S>
      T
      save​(T node)
      Stores the node in the database.
      <T extends S>
      Iterable<T>
      saveAll​(Iterable<T> nodes)
      Saves all given science.neo4j.nodes (create or update)
    • Method Detail

      • deleteAll

        void deleteAll()
        Deletes all science.neo4j.nodes in neo4j that are of type S
      • findAll

        Iterable<S> findAll()
        Returns all node in neo4j that are of type S
        Returns:
        iterator over all S
      • findAllAsStream

        default Stream<S> findAllAsStream()
        Returns all nodes as stream of type S
        Returns:
        stream of all S
      • findById

        S findById​(ID id)
        Returns the node with the given id, or null if no such node exists
        Parameters:
        id - id of node
        Returns:
        node or null
      • findSubtree

        S findSubtree​(ID id)
        Returns the entire subtree of the node with the given id, or null if no such node exists
        Parameters:
        id - id of node
        Returns:
        node with children (infinite depth!) or null
      • findSubtree

        S findSubtree​(ID id,
                      int depth)
        Returns the entire subtree of the node with the given id, or null if no such node exists
        Parameters:
        id - id of node
        depth - depth until the subtree will be loaded (-1 is infinite, 0 is node only)
        Returns:
        node with children up to depth or null
      • findSubtree

        S findSubtree​(ID id,
                      int depth,
                      List<String> relationships)
        Returns the entire subtree of the node with the given id, or null if no such node exists
        Parameters:
        id - id of node
        depth - depth until the subtree will be loaded (-1 is infinite, 0 is node only)
        relationships - that will be loaded (all non mentioned will be omitted)
        Returns:
        node with children up to depth or null
      • save

        <T extends S> T save​(T node)
        Stores the node in the database. If the node has an ID a merge is conducted, if the ID is empty a new node is always created
        Type Parameters:
        T - subtype of S
        Parameters:
        node - node to be stored
        Returns:
        node with ID
      • saveAll

        <T extends SIterable<T> saveAll​(Iterable<T> nodes)
        Saves all given science.neo4j.nodes (create or update)
        Type Parameters:
        T - subtype of S
        Parameters:
        nodes - to be saved
        Returns:
        science.neo4j.nodes with id