I have a main Object called Menu, with a List of objects VoceMenu
public class Menu implements Serializable{
...
@OneToMany(mappedBy="menu", fetch=FetchType.EAGER)
private List<VoceMenu> voceMenuList;
...
}
when I edit a object Menu and then I save it with
...
getCurrentSessionFactory().saveOrUpdate(menu);
...
I can see that on the DB, the value of the fields of the object Menu are edited, the fields of the objects VoceMenu aren't.
Probably I miss something.
Did you set Menu on VoceMenu object before persisting? Try the following:
Also, you need to add cascade = Cascade.PERSIST to make it happen: