Class FutureRepository

  • All Implemented Interfaces:
    Neo4jRepository

    public class FutureRepository
    extends AbstractNeo4JRepository
    In case of cyclic dependencies between repositories we return a future repository that attempts to load when needed. The implementing classes, or another repository mechanism may choose to replace the future repository with the real one later.
    Since:
    1.0
    Author:
    Oliver Krauss
    • Method Detail

      • findBy

        public Object findBy​(String condition,
                             org.neo4j.driver.Value parameters)
        Description copied from class: AbstractNeo4JRepository
        Returns the first node that satisfies the given condition. The condition may access the node with "n" Example: findByCondition("n.name = $name", Values.parameters("name", "Dijkstra"))
        Specified by:
        findBy in class AbstractNeo4JRepository
        Parameters:
        condition - any condition that would be after the "WHERE" in a cypher queryTyped
        parameters - all parameters defined in the condition (parameters optional)
        Returns:
        first node that satisifes condition with parameters
      • findAllBy

        public Iterable findAllBy​(String condition,
                                  org.neo4j.driver.Value parameters)
        Description copied from class: AbstractNeo4JRepository
        Returns ALL science.neo4j.nodes that satisfies the given condition. The condition may access the node with "n" Example: findByCondition("n.name in $names", Values.parameters("names", Values.parameters("Dijkstra", "Knuth", "Turing")))
        Specified by:
        findAllBy in class AbstractNeo4JRepository
        Parameters:
        condition - any condition that would be after the "WHERE" in a cypher queryTyped
        parameters - all parameters defined in the condition (parameters optional)
        Returns:
        first node that satisifes condition with parameters
      • deleteAll

        public void deleteAll()
        Description copied from interface: Neo4jRepository
        Deletes all science.neo4j.nodes in neo4j that are of type S
      • findAll

        public Iterable findAll()
        Description copied from interface: Neo4jRepository
        Returns all node in neo4j that are of type S
        Returns:
        iterator over all S
      • findById

        public Object findById​(Object o)
        Description copied from interface: Neo4jRepository
        Returns the node with the given id, or null if no such node exists
        Parameters:
        o - id of node
        Returns:
        node or null
      • findSubtree

        public Object findSubtree​(Object o)
        Description copied from interface: Neo4jRepository
        Returns the entire subtree of the node with the given id, or null if no such node exists
        Parameters:
        o - id of node
        Returns:
        node with children (infinite depth!) or null
      • findSubtree

        public Object findSubtree​(Object o,
                                  int depth)
        Description copied from interface: Neo4jRepository
        Returns the entire subtree of the node with the given id, or null if no such node exists
        Parameters:
        o - 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
      • saveAll

        public Iterable saveAll​(Iterable nodes)
        Description copied from interface: Neo4jRepository
        Saves all given science.neo4j.nodes (create or update)
        Parameters:
        nodes - to be saved
        Returns:
        science.neo4j.nodes with id
      • save

        public Object save​(Object node)
        Description copied from interface: Neo4jRepository
        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
        Parameters:
        node - node to be stored
        Returns:
        node with ID
      • findSubtree

        public Object findSubtree​(Object o,
                                  int depth,
                                  List relationships)
        Description copied from interface: Neo4jRepository
        Returns the entire subtree of the node with the given id, or null if no such node exists
        Parameters:
        o - 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