File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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: 618
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: 1632
    
    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: 618
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: 1632
    
    7

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

Joined: Jun 05, 2010
Posts: 618
Thanks Bill Gorder for your reply
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updating Multiple table using Hibernate
 
Similar Threads
Trouble with model for calculating and adding table values dependent on multiple rows
view ddl for all triggers
update query wont work in mysql, column name to blame?
MySQLSyntaxErrorException
Hibernate Design