spring-data-neo4j

How can I change neo4j Id to UUID and get finder methods to work?

不打扰是莪最后的温柔 提交于 2019-12-11 05:51:21
问题 Neo4j needs an id field to work which is of type Long. This works well with Spring data neo4j. I would like to have another field of type UUID and have T findOne(T id) to work with my UUID not neo generated Ids. As I am using Spring Data Rest, I don't want to expose neo's id in the URL. http://localhost:8080/resource/{neoId} to http://localhost:8080/resource/{uuid} Any ideas if this is possible? UPDATED { name: "Root", resourceId: "00671e1a-4053-4a68-9c59-f870915e3257", _links: { self: { href

Neo4j: Inserting 7k nodes is slow (Spring Data Neo4j / SpringRestGraphDatabase)

坚强是说给别人听的谎言 提交于 2019-12-11 04:04:55
问题 I'm building an application where my users can manage dictionaries. One feature is uploading a file to initialize or update the dictionary's content. The part of the structure I'm focusing on for a start is Dictionary -[:CONTAINS]->Word . Starting from an empty database (Neo4j 1.9.4, but also tried 2.0.0M5), accessed via Spring Data Neo4j 2.3.1 in a distributed environment (therefore using SpringRestGraphDatabase, but testing with localhost), I'm trying to load 7k words in 1 dictionary.

Entity is not an instance of a persistable class NEO4J 4.0.0

不问归期 提交于 2019-12-11 03:53:09
问题 Spring data neo4j 4.0.0 Release In spring mvc project i am trying to save a node by repository.save() method i am getting error. @NodeEntity public class Category { @GraphId public Long id; public String categoryName; public Category() { } public Category( Long id, String categoryName ) { this.id = id; this.categoryName = categoryName; } } @Configuration @EnableNeo4jRepositories("org.neo4j.example.northwind.repository") @EnableTransactionManagement public class AppContext extends

Spring Web Security locks Neo4j embedded database

删除回忆录丶 提交于 2019-12-11 03:37:30
问题 In continue to my previous issue Neo4j Embedded database hangs after abnormal application termination I noticed that everything works properly if I use graphDatabaseService.shutdown(); method before terminating of my application.. Otherwise after restart my application hangs on the database operations. After hours of investigation I think, I have found the general source of this issue but have no idea right now how to fix it. This is my Spring Boot WebSecurityConfig : @Configuration

spring-data-neo4j remove nodeEntity and all referenced nodes

南笙酒味 提交于 2019-12-11 03:17:58
问题 I've got a simple graph model: 1 User has N SocialUser . I'm wondering if there is any way through spring-data-neo4j to automatically delete all SocialUser referenced when I remove an User entity. This is what I've got so far: Domain: @NodeEntity public class User implements IdentifiableEntity<String> { @GraphId private Long nodeId; // ... @RelatedTo(type = "HAS", direction = Direction.OUTGOING) Set<SocialUser> socialUsers = new HashSet<>(); } @NodeEntity public class SocialUser implements

Spring Data Neo4J template.fetch() not returning entire collection

纵然是瞬间 提交于 2019-12-11 02:45:21
问题 I am completely baffled by this, and am not sure what else I can do to get this to work. Using @Fetch on a relationship, will eagerly fetch that relationship. Template.fetch can be used to fetch a relationship, if the property is not annotated with @fetch, i.e lazy loading. Does this type of lazy loading work with sets? I have a node entity called Project, which has a set of scans. When I try to fetch the set of scans I only get 1 scan. When I modify the Project class to use @Fetch, I get 3

Use neo4j server instead of embedded mode

天涯浪子 提交于 2019-12-11 02:32:01
问题 I'm working on a webapp running on Tomcat which using spring-data to connect to a neo4j graph in embedded mode. I would like to use neo4j server instead of the embedded mode and I am looking for some help to be sure about how to do that. Some of my application services are quite difficult and combine, in a single transaction, the result of several cypher requests in a dto sent back to the user. First I thought that I have to create a server unmanaged extension and I think I should follow

Why does Spring Data Neo4j create an underscore prefixed label on nodes?

匆匆过客 提交于 2019-12-11 02:18:46
问题 I realize that a similar question was asked here, but I'm trying to understand the reasoning behind the approach of SDN to create a label matching my class name, and also creating the same label prefixed by an underscore. So, for example, I have a Patient class. When I create my @NodeEntity decorated Patient class through my Neo4j repository and then query it back through the Neo4j web console, I see Patient and _Patient as the labels. As an extension to this question, say I have the

Neo4j one-to-many fetch data

与世无争的帅哥 提交于 2019-12-11 02:15:22
问题 In my Spring Boot/Neo4j application I have a following entities: @NodeEntity public class User extends BaseEntity { private static final String HAS = "HAS"; @GraphId private Long id; private String username; private String password; private String email; private String firstName; private String lastName; @RelatedTo(type = HAS, direction = Direction.OUTGOING) private Set<Role> roles = new HashSet<Role>(); .... } @NodeEntity public class Vote extends BaseEntity { private static final String

Neo4j Rest Read timed out exception

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 01:28:16
问题 Using Neo4j 1.9 in REST mode and Spring Data for neo4j .. while performing load test on my app I am getting the exception below... com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131) at org.neo4j.rest.graphdb.UserAgent$1.handle(UserAgent.java:68) at com.sun.jersey.api.client.Client.handle(Client.java:616) at com.sun.jersey.api.client