I'm working on a new relational database (not my choice) and at the point where I have to update a record I am calling the save method on the repository - which is dutifully writing both the null and non-null attributes values alike to the database. The behaviour that is required is to only update the non-null values supplied by the client and ignore other attributes with a null value in the update object supplied by the client leaving them unchanged in the database. This behaviour is useful for the common case where the client wants to update the value of a single attribute without affecting any other attribute values in the record. It looks like the solution is to read the value from the database into a parking object, copy over the non-null attribute values from the update request, and then save the whole thing again.
I would like to build a case that this would be simpler to implement in Neo4j. However, the documentation is far from clear what a org.springframework.data.neo4j.repository.GraphRepository does when you call save().
Does calling save and presenting a new node object remove existing attributes unmentioned in the new object? Is there a way to say "save this node, updating and creating attribute values as necessary but preserving any existing attributes"? It would be really handy if there is a way to do this and a significant advantage over the three point turn I am about to continue writing as soon as I have posted this question.