spring-data-neo4j-4

Why is findOne(<id>, <depth>) getting unacceptably slow performance when adding more nodes of the same label?

寵の児 提交于 2021-02-11 13:01:44
问题 CONTEXT I've been developing a spring boot website backed by a Neo4j database. It is designed to work as a university course search system. (the relevant structure is that courses have modulesets, that have modules, that are related to subjects, etc...) @JsonIdentityInfo(generator=JSOGGenerator.class) public class Course extends DomainObject { @NotNull private String name; @NotNull private String courseCode; private String description; private School school; @Convert(AttendanceTypeConverter

Neo4j & Spring Data Neo4j 4.0.0 : Importing large datasets

非 Y 不嫁゛ 提交于 2021-02-10 11:53:33
问题 I want to insert real-time logging data into Neo4j 2.2.1 through Spring Data Neo4j 4.0.0. The logging data is very big which may reach hundreds of thousands records. How is the best way to implement this kind of functionality? Is it safe to just using the .save(Iterable) method at the end of all the node entity objects creation? Is there something like batch insertion mechanism in Spring Data Neo4j 4.0.0? Thanks in advance! 回答1: As SDN4 can work with existing databases directly you can use

How to control depth on custom Spring Data Neo4j repository methods?

℡╲_俬逩灬. 提交于 2020-02-27 06:40:18
问题 For example, if I want to get list of users by name: class UserRepository extands GraphRepository<User> { List<User> findByName(String name); } then how to set loading depth to 2? I tried to find answer in the SDN 4.0.0.RC2 docs, but it isn't contains anything about this issue. 回答1: Derived finders do not yet support a depth. You'll have to write a custom query or use the loadAllByProperty method on the Neo4jTemplate if applicable. This should have been mentioned in the docs, we'll add it.

equivalent of template.createRelationBetween in SDN4

人走茶凉 提交于 2020-01-15 07:37:19
问题 My project is currently use Spring-Data-Neo4J 3.3.0 and I'm trying to use the new 4.0.0.Release version. In my code I have the following code : neo4jTemplate.createRelationshipBetween(eltOrRel, attribute, valueClass, GraphRelationType.HAS_ATT_VALUE, true) What is the equivalent of this code (which is use this method in api in the new version of SDK please ? More especially I don't know how to create a relation of a given type but for a specific class. How can I write such a creation in cypher

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

Spring Data Neo4j - Argument Type Mismatch

北城余情 提交于 2020-01-04 05:41:13
问题 I used Neo4j 3.0.6, neo4j-ogm 2.0.5, Spring boot starter 1.4.1 RELEASE, Lucene 5.5.2 This is my Machine and machineSectionSummary class (I only post the field, actually there are properties and constructors). When I call updateMachineSectionSummary function, after call this function and relaunch the program, I can't call machineRepository.findByName and get the error below. How can I fix this? I already tried to remove the Date, changing the relationship name, but its not working @NodeEntity