This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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: 2994
    
    9

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 OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1 part 2/3
 
Have you checked out Aspose?
 
subject: Update column in child table on Updating some column in parent table
 
It's not a secret anymore!