Package science.aist.neo4j.namespace
Class NamespaceAwareReflectiveNeo4JNodeRepositoryImpl<S>
- java.lang.Object
-
- science.aist.neo4j.repository.AbstractNeo4JRepository<S,Long>
-
- science.aist.neo4j.repository.AbstractNeo4JNodeRepositoyImpl<S>
-
- science.aist.neo4j.reflective.ReflectiveNeo4JNodeRepositoryImpl<S>
-
- science.aist.neo4j.namespace.NamespaceAwareReflectiveNeo4JNodeRepositoryImpl<S>
-
- All Implemented Interfaces:
Neo4jQueryRepository
,Neo4jRepository<S,Long>
public class NamespaceAwareReflectiveNeo4JNodeRepositoryImpl<S> extends ReflectiveNeo4JNodeRepositoryImpl<S>
Repository that also considers namespaces while handling Neo4J. The functionality is identical to the ReflectiveNeo4JNodeRepository, most of the search methods are EXACT meaning that a node has to have all labels EXCEPT:findById -> also works up the hierarchy and not just for the exact match of Labels. findBy -> auto-qualifies fields. Ex. Namespace "example" field "field" the full qualifier would be "example_field". If you use ".findBy("field"...) it will automatically replace it with "example_field", but if you use "xxx_field" it WONT be changed.
- Since:
- 1.0
- Author:
- Oliver Krauss
-
-
Field Summary
-
Fields inherited from class science.aist.neo4j.reflective.ReflectiveNeo4JNodeRepositoryImpl
clazz, info, repositories
-
Fields inherited from class science.aist.neo4j.repository.AbstractNeo4JNodeRepositoyImpl
BULK_RELATIONSHIP_BULK_STATEMENT, BULK_RELATIONSHIP_STATEMENT, CLASSNAME, CREATE_BULK_STATEMENT, CREATE_STATEMENT, DELETE_ALL_STATEMENT, FIND_ALL_STATEMENT, FIND_BY_ID_STATEMENT, FIND_BY_WHERE_STATEMENT, FIND_SUBTREE_STATEMENT, logger, RELATIONSHIP_BULK_STATEMENT, RELATIONSHIP_STATEMENT, UPDATE_BULK_STATEMENT, UPDATE_STATEMENT
-
-
Constructor Summary
Constructors Constructor Description NamespaceAwareReflectiveNeo4JNodeRepositoryImpl(TransactionManager manager, Class<S> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<S>
findAllBy(String field, String value)
Find all science.neo4j.nodes by a field with a given value (eg.Iterable<S>
findAllBy(List<Pair<String,Object>> values)
Find science.neo4j.nodes by a list of fields that should match a given valueS
findBy(String field, String value)
Find node by a field with a given valueS
findBy(List<Pair<String,Object>> values)
Find node by a list of fields that should match a given valueS
findSubtree(Long id, int depth, List<String> relationships)
Returns the entire subtree of the node with the given id, or null if no such node existsprotected String
qualifyLabel(String label)
void
setRelationshipOverrides(Map<String,Class> overrides)
-
Methods inherited from class science.aist.neo4j.reflective.ReflectiveNeo4JNodeRepositoryImpl
cast, findRepository, getId, handleRelationships, handleRelationships, objectify, query, queryAll, setId, setRepositories
-
Methods inherited from class science.aist.neo4j.repository.AbstractNeo4JNodeRepositoyImpl
deleteAll, execute, executeAll, findAll, findAllBy, findBy, findById, findSubtree, findSubtree, init, queryAllHelp, queryAllNormalOrTyped, queryAllTyped, queryHelp, queryNormalOrTyped, queryTyped, save, saveAll, saveBulkRelationship, saveBulkRelationshipBulk, saveRelationship, saveRelationshipBulk
-
Methods inherited from class science.aist.neo4j.repository.AbstractNeo4JRepository
buildParameters, buildWhere, 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
-
NamespaceAwareReflectiveNeo4JNodeRepositoryImpl
public NamespaceAwareReflectiveNeo4JNodeRepositoryImpl(TransactionManager manager, Class<S> clazz)
-
-
Method Detail
-
findBy
public S findBy(String field, String value)
Description copied from class:AbstractNeo4JRepository
Find node by a field with a given value- Overrides:
findBy
in classAbstractNeo4JRepository<S,Long>
- Parameters:
field
- name of field that should matchvalue
- value that should be matched to- Returns:
- first node that has the given value in the field
-
findAllBy
public Iterable<S> findAllBy(String field, String value)
Description copied from class:AbstractNeo4JRepository
Find all science.neo4j.nodes by a field with a given value (eg. n.amount = 3)- Overrides:
findAllBy
in classAbstractNeo4JRepository<S,Long>
- Parameters:
field
- name of field that should matchvalue
- value that should be matched to- Returns:
- all science.neo4j.nodes that have the given value in the field
-
findBy
public S findBy(List<Pair<String,Object>> values)
Description copied from class:AbstractNeo4JRepository
Find node by a list of fields that should match a given value- Overrides:
findBy
in classAbstractNeo4JRepository<S,Long>
- Parameters:
values
- Key Value pairs where the key is the fieldname and the value is the value the field should match- Returns:
- first node that matches on all fields
-
findAllBy
public Iterable<S> findAllBy(List<Pair<String,Object>> values)
Description copied from class:AbstractNeo4JRepository
Find science.neo4j.nodes by a list of fields that should match a given value- Overrides:
findAllBy
in classAbstractNeo4JRepository<S,Long>
- Parameters:
values
- Key Value pairs where the key is the fieldname and the value is the value the field should match- Returns:
- all science.neo4j.nodes that match fields
-
findSubtree
public S findSubtree(Long id, int depth, List<String> relationships)
Description copied from interface:Neo4jRepository
Returns the entire subtree of the node with the given id, or null if no such node exists- Specified by:
findSubtree
in interfaceNeo4jRepository<S,Long>
- Overrides:
findSubtree
in classAbstractNeo4JNodeRepositoyImpl<S>
- 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
-
setRelationshipOverrides
public void setRelationshipOverrides(Map<String,Class> overrides)
- Overrides:
setRelationshipOverrides
in classReflectiveNeo4JNodeRepositoryImpl<S>
-
-