Package science.aist.neo4j
Interface Neo4jRepository<S,ID>
-
- Type Parameters:
S
- Node class that we want to storeID
- ID of the node in the database
- All Known Implementing Classes:
AbstractNeo4JNodeRepositoyImpl
,AbstractNeo4JRelationshipRepositoyImpl
,AbstractNeo4JRepository
,FutureRepository
,NamespaceAwareReflectiveNeo4JNodeRepositoryImpl
,ReflectiveNeo4JNodeRepositoryImpl
,ReflectiveNeo4JRelationshipRepositoryImpl
public interface Neo4jRepository<S,ID>
Interface for our Neo4j repositories- Since:
- 1.0
- Author:
- Oliver Krauss
-
-
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 SIterable<S>
findAll()
Returns all node in neo4j that are of type Sdefault Stream<S>
findAllAsStream()
Returns all nodes as stream of type SS
findById(ID id)
Returns the node with the given id, or null if no such node existsS
findSubtree(ID id)
Returns the entire subtree of the node with the given id, or null if no such node existsS
findSubtree(ID id, int depth)
Returns the entire subtree of the node with the given id, or null if no such node existsS
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>
Tsave(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 nodedepth
- 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 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
-
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
-
-