有一個註冊了RestResource(Spring 3.1,Jackson 2.3)的類。 當我們試圖保存對象的那樣使用Spring Rest Resource更新空值更多信息
A: {"prop1":1, "prop2":2}
它成功保存。
我們有以下代碼:
A.setProp2(null);
EntityService.patch(A);
A: {"prop1":1, "prop2":null}
EntityService.patch(A)執行後,是DB(的Oracle 11g)沒有變化,但我們希望,在DB PROP2將等於空了。
這是一個正常的行爲(我想也許是的,因爲空值可能理解像沒有改變)? 有沒有簡單的方法來改變這種行爲?
正是我發現的,謝謝。更多信息 - https://spring.io/understanding/REST – egorlitvinenko