Hibernate updates only some fields

In some cases, I want to update only one column, but I do not want to get the object from the database, and I only have its identifier and value that I want to update.

Since the rest of the values ​​are zero, sleep mode is updated, then as null. Some criteria are interesting for removing other columns from the update.

I read about dynamic-update = true and only unchanged properties excluded it. But null values ​​are still present during my upgrade.

Does anyone have any ideas? Thank you Felipe

+7
java sql hibernate
source share
1 answer

You must get the object from the database, change the value and save it. If you do not want this, you must write your own request.

+6
source share

All Articles