spring-data-neo4j

How can you customise self, parent, children links in spring data rest with neo4j

我的未来我决定 提交于 2019-12-31 02:35:07
问题 I am using spring data rest to create an API over neo4j. I don't want to expose nodeId in my URLs, therefore I have a UUID instead. More info on here: How can I change neo4j Id to UUID and get finder methods to work? How can I modify the auto-generated links by the spring-data-rest to reflect the change to UUID instead of nodeId? Thanks ----UPDATED--- public class CustomBackendIdConverter implements BackendIdConverter { @Autowired PracticeAreaRepository practiceAreaRepository; @Override

How to get Spring Data Neo4j and Spring Data JPA to work together?

依然范特西╮ 提交于 2019-12-31 02:18:09
问题 I have an application that does some batch jobs using MySQL and, via REST, Neo4j server version. I can't figure out how to make them to work together correctly: I can get to make work both of them, but not at the same time. The posts I've found around are not specific to the server version of Neo4j, and maybe that's where the problem is, since everything else seems ok to me. My configuration: JpaConfig @Configuration @EnableTransactionManagement(order=Ordered.HIGHEST_PRECEDENCE)

Lazy/Eager loading/fetching in Neo4j/Spring-Data

徘徊边缘 提交于 2019-12-28 12:28:13
问题 I have a simple setup and encountered a puzzling (at least for me) problem: I have three pojos which are related to each other: @NodeEntity public class Unit { @GraphId Long nodeId; @Indexed int type; String description; } @NodeEntity public class User { @GraphId Long nodeId; @RelatedTo(type="user", direction = Direction.INCOMING) @Fetch private Iterable<Worker> worker; @Fetch Unit currentUnit; String name; } @NodeEntity public class Worker { @GraphId Long nodeId; @Fetch User user; @Fetch

Lazy/Eager loading/fetching in Neo4j/Spring-Data

可紊 提交于 2019-12-28 12:28:12
问题 I have a simple setup and encountered a puzzling (at least for me) problem: I have three pojos which are related to each other: @NodeEntity public class Unit { @GraphId Long nodeId; @Indexed int type; String description; } @NodeEntity public class User { @GraphId Long nodeId; @RelatedTo(type="user", direction = Direction.INCOMING) @Fetch private Iterable<Worker> worker; @Fetch Unit currentUnit; String name; } @NodeEntity public class Worker { @GraphId Long nodeId; @Fetch User user; @Fetch

No qualifying bean of type 'java.lang.Class<org.springframework.data.repository.Repository<?, ?>>'

 ̄綄美尐妖づ 提交于 2019-12-25 18:41:18
问题 Application depends on a number of spring data projects including Neo4j, Solr and Jpa. I recently had to update spring-data-solr to Snapshot-3.0.0.M1 (to eliminate another dependency conflict). I think one of the transitive dependency is causing a conflict with neo4j. If I remove spring-neo4j from project, error (see below) seem to go away. I have a attached a sample project that recreates the issue. Run Test Class AccountServiceJpaTester.testSaveAccount() Download sample project from here

Trouble reading neo4j rest api query results interatively

孤街醉人 提交于 2019-12-25 07:29:18
问题 I really hope this hasn't been asked and my search skills lacking. I am currently learning how spring data interacts with the neo4j stand-alone server via the rest api (spring-data-neo4j-rest) and ran into an interesting issue with iterating a query result. I started by creating the neo4j project (using an embedded db) found in the book Instant Spring Tool Suite, verifying that it worked, upgrading the project to the most recent release of Spring, verifying that worked and then pointed it at

spring boot - neo4j - java.lang.IllegalArgumentException: argument type mismatch

寵の児 提交于 2019-12-25 04:49:16
问题 I'm having a trouble with mapping an object Employee to my database when invoking a default method in my Employee repository. I get an argument type mismatch when invoking an employeerepository.findall() method Employee repository package org.jarivm.relationGraph.repositories; import org.jarivm.relationGraph.domains.Employee; import org.jarivm.relationGraph.domains.Project; import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.neo4j.repository.GraphRepository

Spring Data Neo4j “Hello, World” standalone app

主宰稳场 提交于 2019-12-25 03:43:39
问题 I'm trying to write a "Hello, World" with Spring Data Neo4j in a standalone app. It runs and actually creates the Neo4j database, but my @Autowired repo is not being initialized. I suspect the problem is in my main class, but I don't know what to try. Unsurprisingly, almost all the Spring tutorials I've found are about web apps. What am I doing wrong? config bean: @Configuration @EnableNeo4jRepositories(basePackages = "test2") public class ConfigBean extends Neo4jConfiguration { private

Set a transient property on a node neo4j

微笑、不失礼 提交于 2019-12-25 03:32:39
问题 Is there way to set a transient property on nodes returned by a cypher query such that it is only visible to the user running the query. This would allow us offload some controller logic directly into Neo4j and reduce business logic queries. Currently I have a list that is returned by List<Post> newsFeed (Long uid) {} Post is a relationship between a User and News node. I have two sub-classes of the Post object: BroadcastedPost MentionedPost I have two cypher queries that return the posts

Spring Data Neo4j - relationship properties on complex type class members

扶醉桌前 提交于 2019-12-24 22:07:12
问题 I have a class annotated with @RelationshipEntity. This class contains of object defined by me with some integer values. Is it possible somehow to define that members of the nested object will be saved as properties on the relationship? Justyna. 回答1: Yes, but they should be converted to strings providing customized Spring converters. To avoid declaring a converter for each class you need to embed, you could extend a common interface (even an empty one, just to declare the converters). The