• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

selective column update

 
Gina vernon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am not sure if such functionality is available in hibernate but this is what I am trying to do:

I have table



User loads the entities in this table to edit. When the user edits the records depending on whether colA OR colB are updated, only colC OR colD must be updated. Otherwise the update should not be done. Is there anyway of accomplishing this?

Thanks.
 
Emanuel Kadziela
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean like a database trigger?

As far as I know, there is no "auto-magic" way to get hibernate to handle this for you. But it should not be very hard to implement a private setter on columns c and d in your java object and call those setters only from the public setters of a and b, right?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic