How do I tell Play Framework 2 and Ebean to save null fields?

后端 未结 2 1839
囚心锁ツ
囚心锁ツ 2021-02-08 01:16

I\'m using Play Framework 2 and Ebean. When a user submits a form to edit an existing object in the database, it doesn\'t save null values. I guess this is to prevent overwrit

2条回答
  •  灰色年华
    2021-02-08 01:45

    Create an ebean.properties file right next to the application.conf file and add this line to it:

    ebean.defaultUpdateNullProperties=true
    

提交回复
热议问题