Class ReflectiveNeo4JNodeRepositoryImpl<S>

    • Constructor Detail

      • ReflectiveNeo4JNodeRepositoryImpl

        protected ReflectiveNeo4JNodeRepositoryImpl​(TransactionManager manager)
        Internal constructor for pushing through the manager to the top level
        Parameters:
        manager - used to handle transactions
      • ReflectiveNeo4JNodeRepositoryImpl

        public ReflectiveNeo4JNodeRepositoryImpl​(TransactionManager manager,
                                                 ParameterizedType type)
        Generates the repository by a Generic Type
        Parameters:
        manager - used to handle transactions
        type - type of the handled class
      • ReflectiveNeo4JNodeRepositoryImpl

        public ReflectiveNeo4JNodeRepositoryImpl​(TransactionManager manager,
                                                 Class<S> clazz)
    • Method Detail

      • cast

        protected S cast​(org.neo4j.driver.Value value,
                         org.neo4j.driver.Value rels,
                         org.neo4j.driver.Value nodes)
        Description copied from class: AbstractNeo4JNodeRepositoyImpl
        Casts the result of the queryTyped into a DomainObject
        Specified by:
        cast in class AbstractNeo4JNodeRepositoyImpl<S>
        Parameters:
        value - the value to be casted as root
        rels - the relationships in the subgraph
        nodes - the relationships are pointing to
        Returns:
        the casted result
      • handleRelationships

        protected <T extends S> T handleRelationships​(T node)
        Description copied from class: AbstractNeo4JNodeRepositoyImpl
        Helper method that is responsible for storing all relationships. Use "saveRelationship" and "saveRelationshipBulk" when implementing this method!
        Specified by:
        handleRelationships in class AbstractNeo4JNodeRepositoyImpl<S>
        Type Parameters:
        T - extension of S
        Parameters:
        node - to be saved
        Returns:
        node
      • handleRelationships

        protected <T extends SCollection<T> handleRelationships​(Collection<T> nodes)
        Description copied from class: AbstractNeo4JNodeRepositoyImpl
        Helper method that is responsible for storing all relationships in a multitude of nodes Use "saveBulkRelationship" and "saveBulkRelationshipBulk" when implementing this method
        Specified by:
        handleRelationships in class AbstractNeo4JNodeRepositoyImpl<S>
        Type Parameters:
        T - extension of S
        Parameters:
        nodes - the nodes with relations which should be handled
        Returns:
        the stored nodes
      • query

        public <T> T query​(String query,
                           org.neo4j.driver.Value parameters,
                           Class<T> clazz)
        Description copied from interface: Neo4jQueryRepository
        Method for executing a query with a single result in a own transaction
        Specified by:
        query in interface Neo4jQueryRepository
        Overrides:
        query in class AbstractNeo4JNodeRepositoyImpl<S>
        Type Parameters:
        T - Result type
        Parameters:
        query - The query text
        parameters - The query parameters
        clazz - The result clazz type
        Returns:
        Single query result
      • queryAll

        public <T> Stream<T> queryAll​(String query,
                                      org.neo4j.driver.Value parameters,
                                      Class<T> clazz)
        Description copied from interface: Neo4jQueryRepository
        Method for executing a query with multiple results in a own transaction
        Specified by:
        queryAll in interface Neo4jQueryRepository
        Overrides:
        queryAll in class AbstractNeo4JNodeRepositoyImpl<S>
        Type Parameters:
        T - Result type
        Parameters:
        query - The query text
        parameters - The query parameters
        clazz - The result clazz type
        Returns:
        Stream of results
      • setRepositories

        public void setRepositories​(Map<Class,​AbstractNeo4JRepository> repositories)
        Not required as not all Nodes have relationships to other science.neo4j.nodes.
        Parameters:
        repositories - All related repositories are required
      • setRelationshipOverrides

        public void setRelationshipOverrides​(Map<String,​Class> overrides)