p_sudheers wrote:
Hello Friends,
I am using Hibernate 3 with Spring 2 and I am a newbie.
I have 2 tables persons and activities, It is a one-to-many relationship, one person can have many activities. What I need is, whenever an activity is added for a person I need to update the activity_status column of that particular person in the person table.
How to update the activity_status in person table? Can somebody give me some hint?
Thank you
Sudheer
Just set the new status in the Person object, add the Activity to the collection of activities for the Person and invoke update. If the cascade constraints are correct, HB will add the new Activity (setting the FK to Person) and update the status on the person