spring-data-neo4j

Spring Data Neo4j: filter by LocalDate doesn't work

时光毁灭记忆、已成空白 提交于 2020-01-06 06:52:10
问题 My small Neo4j playground application (based on Spring Boot 2, Spring Data Neo4j and the embedded driver) is a small note-keeping software. The users can filter their notes by creation date. To get a better understanding of Cypher I wrote the Cypher query using SDN's @Query ( NoteRepo.findByDay(day) ). However I can't get the filtering working. I'm confused that the LocalDate was transformed into a map (last line of the console output). In the previous query ( NoteRepo.findBySnoozeUntil(day)

Spring Data Neo4j 4.0.0.M1 Test Configuration

二次信任 提交于 2020-01-05 10:39:48
问题 I am very new to Spring Data and I am trying to configure my Spring Data Neo4j 4.0.0.M1 Test. It has taken me 2 days without any result and I can't seem to find any example on SDN4 to do this. Here is my simple test class : @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = MyConfigurationTest.class) @DirtiesContext public class ProjectRepositoryTests { @Autowired PlatformTransactionManager transactionManager; @Autowired ProjectRepository projectRepository; @Transactional

How do I query for relationship data in spring data neo4j 4?

落花浮王杯 提交于 2020-01-05 09:28:11
问题 I have a cypher query that is supposed to return nodes and edges so that I can render a representation of my graph in a web app. I'm running it with the query method in Neo4jOperations. start n=node({id}) match n-[support:SUPPORTED_BY|INTERPRETS*0..5]->(argument:ArgumentNode) return argument, support Earlier, I was using spring data neo4j 3.3.1 with an embedded database, and this query did a fine job of returning relationship proxies with start nodes and end nodes. I've upgraded to spring

How to modeling this relation in spring data neo4j?

时光怂恿深爱的人放手 提交于 2020-01-05 06:32:32
问题 Given I have two entity: Person and Company , and there are multiple relationships between them: Person - Company: The person can be the employee of the company The person can be the shareholder of the company The person can be the legal person of the company Company - Company: The company can be the legal of the company The company can be the shareholder of the company So how to modeling this in spring data neo4j? What I tried is make 3 relationship types: EMPLOY, INVEST, LEGAL, each

How to modeling this relation in spring data neo4j?

允我心安 提交于 2020-01-05 06:32:28
问题 Given I have two entity: Person and Company , and there are multiple relationships between them: Person - Company: The person can be the employee of the company The person can be the shareholder of the company The person can be the legal person of the company Company - Company: The company can be the legal of the company The company can be the shareholder of the company So how to modeling this in spring data neo4j? What I tried is make 3 relationship types: EMPLOY, INVEST, LEGAL, each

Cypher: Query that converts property from int to String is very slow and causes OutOfMemoryError in Neo4j server

怎甘沉沦 提交于 2020-01-05 04:15:07
问题 I need to migrate the type of a numerical property to be of type String. For that I wrote the simple following query: MATCH (n:Entity) SET n.id=toString(n.id) RETURN n It matches about 1,2 million entities (according to EXPLAIN), so I didn't expect it to be fast. However, it didn't terminate after more than 5 hours. In the meantime neo4j server (community, 3.0.4) ran at close to 100% load. I have this configured in the corresponding neo4j.conf: dbms.memory.heap.initial_size=4g dbms.memory

Use @NodeEntity on interface/abstract class

核能气质少年 提交于 2020-01-05 03:35:36
问题 Is it possible to add @NodeEntity (or even @RelationshipEntity ) annotation from SpringData Neo4j on an interface or abstact class or their fields? If not, how do you manage these situations? 回答1: Definitely you can do that on Abstract classes , and I think it's a good practice in some common cases. Let me give you an example that I'm using in my graph model: @NodeEntity public abstract class BasicNodeEntity implements Serializable { @GraphId private Long nodeId; public Long getNodeId() {

Spring Neo4j: Same cypher query taking different time when executed through different consoles

让人想犯罪 __ 提交于 2020-01-05 03:03:47
问题 Same cypher query taking different time when executed through different consoles: Executed via spring-data-neo4j: (took 8 seconds) @Query( "MATCH (user:User {uid:{0}})-[:FRIEND]-(friend:User)" + "RETURN friend" ) public List<User> getFriends(String userId); Executed via http://localhost:7474/browser/ : (took 250 ms) Executed via http://localhost:7474/webadmin/#/console/ : (took 18 ms) Even though queries executed via console are very fast and taking time under acceptable range but for

Cannot resolve reference to bean 'neo4jTemplate'

别说谁变了你拦得住时间么 提交于 2020-01-04 05:58:58
问题 I try to configure my application to use spring data neo4j . But when i complied my application i get this stack track trace : SEVERE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot resolve reference to bean 'neo4jTemplate' while setting bean property

Cannot resolve reference to bean 'neo4jTemplate'

半世苍凉 提交于 2020-01-04 05:58:10
问题 I try to configure my application to use spring data neo4j . But when i complied my application i get this stack track trace : SEVERE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot resolve reference to bean 'neo4jTemplate' while setting bean property