• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating Multiple table using Hibernate

 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement where i need to update 6 tables. Each table contains a status column. I need to update the status column of those rows where id = 1.
So, should i go for manually fetching all rows from each table and update it in a single class? or is there any other easy and suitable way to update the tables?


 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't sound like there is a relationship between the tables other than having a status column (which is not really a relationship). I would address each one independently rather than trying to tie things together where there is no relationship.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Bill Gorder. There is no relationship between the tables. So, according to you, i need to fetch records from each table and update it's status column? Right?
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I understand, that is what I would do.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill Gorder for your reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic