spring-data-neo4j-4

GraphRepository find method on 2nd level relationship

余生颓废 提交于 2019-12-12 04:23:11
问题 I am using spring-data-neo4j-4.2.0.RC1 and neo4j-ogm-core-2.1.0.jar Have the following domain objects User -> Role -> Priviledge public class User extends BaseEntity{ private String firstName; private String lastName; @Relationship(type="ROLE") private Role role; } @NodeEntity public class Role extends BaseEntity{ private String name; @Relationship(type="PRIVILEDGE") private Priviledge priviledge; } @NodeEntity public class Priviledge extends BaseEntity { private String name; } public

Spring Data Neo4j 4 : findByPropertyIsNull is not working

 ̄綄美尐妖づ 提交于 2019-12-12 04:16:15
问题 Using SDN 4.0 and having this entity, offering a tree of Interests (Parent and Children) @NodeEntity public class Interest { @GraphId private Long id; private Interest parent; private List<Interest> children = new ArrayList<Interest>(); private String label; public Interest(){ } public Interest(Interest parent, String label) { super(); this.parent = parent; this.label = label; if (this.parent!=null && !this.parent.getChildren().contains(this)) getChildren().add(this); } public List<Interest>

SDN 4 Session.query doesn't work for @QueryResult

谁都会走 提交于 2019-12-12 03:37:18
问题 In my SDN 4 project I have a @QueryResult POJO: @QueryResult public class WeightedDecision { private Decision decision; private double weight; public Decision getDecision() { return decision; } public void setDecision(Decision decision) { this.decision = decision; } public double getWeight() { return weight; } public void setWeight(double weight) { this.weight = weight; } } And a lot of Spring Data Neo4j repository methods that work fine with this WeightedDecision query result. Right now I'm

Is there a way to get all the labels for a node in SDN 4.0

谁都会走 提交于 2019-12-12 03:28:29
问题 I want to get all the labels belongs to a node, if there a way to do this in one query in SDN 4.0? For example, my current repo is like Book findById(Long bookId); @Query("MATCH (n:Book) where id(n)={0} set n:AnotherLabel return n") Book updateBookLabel(Long bookId); is there anyway I can simply book.getLabels(); to retrieve all the labels for this book node. the class for book is @NodeEntity public class Book extends Something { } Yes, by default, my Book node should has two label Book and

neo4j java node dynamic properties

纵然是瞬间 提交于 2019-12-12 03:06:49
问题 I am trying to create nodes of a specific type with properties which can be dynamic . For Example : I can create a Person node with name,age,address properties. But these need not be the only properties when I create another Person node. This node can have name,age,address and an additional property salary. Using spring data or query DSL needs me to create Java POJO class Person with fixed number of instance variables name,age and address . @NodeEntity public class Person { @GraphId private

SDN4: ClassCastException: java.util.HashMap cannot be cast to [EntityNode]

谁都会走 提交于 2019-12-12 03:00:56
问题 An issue has appeared for our code after updating to SDN4: java.lang.ClassCastException: java.util.HashMap cannot be cast to com.example.server.model.neo4j.node.Item at com.example.server.service.relationship.friend.FriendRelationshipService.getSkillUuidByPotentialSkillName (FriendRelationshipService.java:257) at com.example.server.service.relationship.friend.FriendRelationshipService.createFriendRequestRelationshipBetweenPeople(FriendRelationshipService.java:211) at com.example.server

SDN4 custom query pagination alternative for Page contents

送分小仙女□ 提交于 2019-12-12 02:51:53
问题 Currently Pagination isn't supported in SDN4 (Ref: Paging and sorting in Spring Data Neo4j 4) It's possible to specify the SKIP and LIMIT clauses ourselves to retrieve parts of the results, however for our system we also need the getTotalPages(), isFirst() and isLast() values from the Page returned when performing a custom paging query. Is there an alternative way for us to retrieve these values using SDN4 / OGM? Alternatively, are there any recommendations / references to code that can be

@Index annotation in SDN4

我怕爱的太早我们不能终老 提交于 2019-12-12 02:28:05
问题 Why there is an @Index annotation in SDN4 if it does not manage Neo4j indexes anymore? In SDN3 it was used to populate indexes in the database, but now, taking into account the documentation, it is not. 回答1: It shouldn't be there any more- it isn't used and will be removed. 来源: https://stackoverflow.com/questions/33637661/index-annotation-in-sdn4

Always loading certain child object in neo4j

好久不见. 提交于 2019-12-11 14:53:15
问题 class Node { Long id; String name; @Relationship(type="NodeToCategory") Address address; List<NodeB> nodeBList; } //node B CLass class NodeB { Long id; String someOther; @Relationship(type="NodeToCategory") Address address; List<NodeC> nodeCList; } class Address { Long id; String name; } When I run a query with depth 2 on the Node it returns nodeBList but it does not return addresses of NodeB. I want to make sure whenever there is an address object it will always return address no matter the

Why does Neo4j OGM with Spring Boot 2.0.0.M4 apparently require the embedded driver?

自作多情 提交于 2019-12-11 14:26:50
问题 I have been trialling Spring Boot 2 (2.0.0.M4 at this stage) with the latest Spring Data Neo4j (currently 5.0.0.RC3) and can't seem to get it running. I get the following error: org.neo4j.ogm.exception.ConfigurationException: Could not load driver class org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver I don't ask for an embedded driver, nor do I want one. I only want to use the bolt driver, which is already a dependency of spring-data-neo4j. I've published a project to Github that was