subich wrote:
If you populate the good key Hibernate manage the update alone.
I know. I don't have my mapping files now, but I will try to explain for you.
I have a User.hbm.xml and Group.hbm.xml.
In User.java has a "Collection groups".
In my WebWork Action, I have the save() and getUser() methods.
Quote:
public class Action. implements Action
{
private User user = new User();
public void save(){
session.saveOrUpdate(user);
// Will this delete all groups from this User?
}
// get/set to User
}
WebWork will instanciete a new object User, then this object has a Collection groups=null. Then, Hibernate will delete all groups.
Because this, I'm loading a object with same primary key from database.
any idea?
Thank you