Package science.aist.neo4j.repository
Class FutureRepository
- java.lang.Object
-
- science.aist.neo4j.repository.AbstractNeo4JRepository
-
- science.aist.neo4j.repository.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
-
-
Constructor Summary
Constructors Constructor Description FutureRepository(TransactionManager manager, String signature)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteAll()
Deletes all science.neo4j.nodes in neo4j that are of type SIterable
findAll()
Returns all node in neo4j that are of type SIterable
findAllBy(String condition, org.neo4j.driver.Value parameters)
Returns ALL science.neo4j.nodes that satisfies the given condition.Object
findBy(String condition, org.neo4j.driver.Value parameters)
Returns the first node that satisfies the given condition.Object
findById(Object o)
Returns the node with the given id, or null if no such node existsObject
findSubtree(Object o)
Returns the entire subtree of the node with the given id, or null if no such node existsObject
findSubtree(Object o, int depth)
Returns the entire subtree of the node with the given id, or null if no such node existsObject
findSubtree(Object o, int depth, List relationships)
Returns the entire subtree of the node with the given id, or null if no such node existsObject
save(Object node)
Stores the node in the database.Iterable
saveAll(Iterable nodes)
Saves all given science.neo4j.nodes (create or update)-
Methods inherited from class science.aist.neo4j.repository.AbstractNeo4JRepository
buildParameters, buildWhere, findAllBy, findAllBy, findBy, findBy, getProvidedRepository, getTransactionManager, provideRepository
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface science.aist.neo4j.Neo4jRepository
findAllAsStream
-
-
-
-
Constructor Detail
-
FutureRepository
public FutureRepository(TransactionManager manager, String signature)
-
-
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 classAbstractNeo4JRepository
- Parameters:
condition
- any condition that would be after the "WHERE" in a cypher queryTypedparameters
- 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 classAbstractNeo4JRepository
- Parameters:
condition
- any condition that would be after the "WHERE" in a cypher queryTypedparameters
- 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 nodedepth
- 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 nodedepth
- 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
-
-