How to explicit set NULL value in a column in hibernate using setter method?
I am reading an Excel file to populate a database table using Hibernate + Apache POI XSSF. For inserting the data, I am using the SETTER methods of the hibernate properties along with session.save()
instead of using the traditional INSERT ap开发者_开发问答proach.
The problem is that I want to explicitly set NULL values into nullable columns using setter methods when the corresponding Excel cell content is empty.
Please suggest how to achieve this.
Doesn't entity.setFoo(null);
work?
精彩评论