This situation is easy to work around but I'm curious if this is a bug, or if someone knows why this behaves this way. I have a complicated component structure, because I'm using JAXB created entities, and want to minimize modifications to generated code.
The structure that got me into trouble was
Component root contains Component A under two different properties, firstA and secondA. Component A has a list (a bag of composite-element's) of Component B. Each list is mapped to a different table.
If I construct root by adding the same instance of Component A to root, when I saved I'd get a "Found shared references to a collection". If I construct two different instances of A, this works, even though the B's are the same instance. I would have thought since these were all components, this would all work... it correctly can figure out that the A's or B's should be treated as if they were separate instances, but the fact that there's a collection leads to an error.
Anyone get this?
|