It's not a secret anymore!*
The moose likes Object Relational Mapping and the fly likes Update column in child table on Updating some column in parent table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Update column in child table on Updating some column in parent table" Watch "Update column in child table on Updating some column in parent table" New topic
Author

Update column in child table on Updating some column in parent table

RamandeepS Singh
Ranch Hand

Joined: Aug 25, 2009
Posts: 63
Hi

I have one table user and child table user_details and in both tables I have column named as status.

I want that whenever I update the status column in user table it also get updated in user_details table

I am using hibernate


Thanks Ramandeep S
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2524
    
    8

Don't know how you set up your hibernate. But in plain sql terms assuming there is a foreign key linking parent table to child table then you will issue 2 update statements.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Update column in child table on Updating some column in parent table