I am trying to get Hibernate to automatically update a child record when the parent is saved. Is this possible?
In all the examples I've seen you can use the cascade flag to add child records.
For example in
http://docs.jboss.org/hibernate/core/3. ... ild-update we see the following:
parent.addChild(child);
Child newChild = new Child();
parent.addChild(newChild);
session.update(parent);
session.flush();
Now, what I am trying to do is more like this:
parent.getChilds.get(0).setName("a");
session.saveOrUpdate(parent);
Is this doable? Should I try a different approach? I thank you in advance.