I've read over the manual regarding Entity Lifecycle Management. I have
entity A which when loaded from database has child entities B1 and B2.
Suppose I add to the child collection B3. When I merge A which is
CascadeType.ALL, B3 is not inserted. From the manual:

If A is a new entity, a new managed entity A' is created and the state
of Ais copied into
A'.

(In the above line, substitute B3 for A.) So B3 should have a managed B3'
created, but should it be persisted? Am I understanding things right? At
this point, I am iterating over the child collection and calling persist for
any new entities (in a transaction that A is merged in). Is there a better
way to do this?

How do you folks go about adding children to an existing entity?

Thanks.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:[email protected]

Reply via email to