aspose file tools*
The moose likes Object Relational Mapping and the fly likes Updating Multiple table using Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Updating Multiple table using Hibernate" Watch "Updating Multiple table using Hibernate" New topic
Author

Updating Multiple table using Hibernate

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
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?



kunal
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1676
    
    7

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.


[How To Ask Questions][Read before you PM me]
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
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

Joined: Mar 07, 2010
Posts: 1676
    
    7

From what I understand, that is what I would do.
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Thanks Bill Gorder for your reply
 
jQuery in Action, 2nd edition
 
subject: Updating Multiple table using Hibernate