JPA - nested collection element of embedded
I have read JPA specifications - and on section 2.6 (Collections of Embeddeble classes and basic types).
It says that "An embeddable class that is contained within an element collection, must not contain an element collection".
I have a requirement of such a structure. I was wondering what is the standard way to bypass this problem. That is, to have a collection of elements, that their type is an embeddable class, that may contain a collection of elements).
It is important for me to achieve this, while still keeping it as an embeddable class.
Have you considered subclassing C?
So you would have C_A and C_B which extends C, and A has a C_A and B has C_B. Then C_A and C_B can reference their parents..