MySQL 4.0.20
Hibernate 2.1.4
Tomcat 5.0.19
Summary:
User has the property "userStatus" which references a "UserStatus" object. User -> UserStatus is mapped as a many-to-one since a User will have a UserStatus assigned to them.
All of this works, however in the case when the administrator goes and edits the UserStatus directly (e.g. to change the name), when the admin then goes back to view the User list, the UserStatus name is not updated. After about 5 mins then the User gets the new values for UserStatus, but it is not immediate.
Question:
How/can I setup my mappings such that the Parent > Child relationship between User and UserStatus actually UPDATES the parent when the child is modified? I was under the impression that hibernate took care of this kind of stuff, but I must admit Hibernate is still a black box to me as I'm learning it.
Detail:
User has the follow many-to-one mapping to UserStatus:
Code:
<many-to-one
name="userStatusDTO"
class="com.kallasoft.paloverde.dto.user.UserStatusDTO"
cascade="none"
outer-join="auto"
column="user_status_id"
/>
UserStatus is just a straight DTO that contains an id, name and description from the DB.