Hibernate : partial update of row using Primary key
posted 7 years ago
I have a scenario in Hibernate where in I have the Primary key information of a table and I want to update a specific column value.
I don't want to load all the column data for each row as the number of columns is pretty large. When I try to do something like this Hibernate updates the specific column in the database but nullifies all the existing column data.
I tried searching on this topic and could not get a worthwhile solution. Is there a way where I can carry out a update to a table row purely based on the Primary Key. I don't want to pre-load all the column data attributes as for this scenario as i don't want the extra column data but at the same time I don't even want to loose it when Hibernate fires the update.
Is there a way to achieve this is Hibernate
You know, this sound like it might be a job for just some simple SQL. I mean, you're sort of saying that you want to do a quick update, but not take advantage of all of the benefits of Hibernate. So, the solution would be just a quick and simple update without using Hibernate. There's no shame in issuing an SQL statement when it's an appropriate solution.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads