SAGGI
SAGGI

Reputation: 1

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 approach.

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.

Upvotes: 0

Views: 4463

Answers (1)

Bozho
Bozho

Reputation: 597026

Doesn't entity.setFoo(null); work?

Upvotes: 1

Related Questions