Java – hibernate only updates some fields
•
Java
In some cases, I want to update only one column, but I don't want to get the object from the database. I only have its ID and the value I want to update
Hibernate will update to null because other values are null I want to know some criteria to delete other columns in the update
I read that dynamic - update = true, which excludes only unmodified attributes However, there are still null values in my update
Does anyone have an idea? thank you! Felipe
Solution
You must get the object from the database, change the value, and save it If you don't want to, you must write your own query
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码