How to ignore null and empty value when use Neo4jOperations.save() to update properties with Spring Data Neo4j? -
spring-data-neo4j : 4.1.2
neo4j:3.0.3
node :
person {id:1, name:"aa", cover:"1.jpg"}
class:
@nodeentity public class person{ @graphid private long id; private string name; private string cover; ... }
new object:
person p = new person(); p.setid(1); p.setname("bb");
then update data:
p = neo4joperations.save(p,0);
or:
personrepo.save(p,0); // interface extends graphrepository<person>
result:
person {id:1, name:"bb"}
question: cover property has been deleted,because p.cover null. there way can ignore null value when update?
no, not supported in sdn. null value means property removed underlying graph.
you can still write custom cypher query though (this defeat purpose of sdn if major use case)
Comments
Post a Comment