java - Null values update with Spring Rest Resource -


there class annotated restresource (spring 3.1, jackson 2.3). when try save object that

a: {"prop1":1, "prop2":2}  

it saved successfully.

we have following code:

a.setprop2(null); entityservice.patch(a); a: {"prop1":1, "prop2":null}  

after entityservice.patch(a) execution there no changes in db (oracle 11g), want in db prop2 equals null too.

is normal behaviour (i think maybe yes, because null-value may understanding not changed)? there simple way change behaviour?

when speaking http verbs, patch request describes differences should made existing object. made can create partial updates without exposing particular resource property throught rest.

in spring framework, in context of patch request, null value of property means no change property should made. guess spring data rest transpons logic service layer, in order update resource null value should issue call corresponding put semantics


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -