Embedded element/key/value types should not be limited to simple fields and 
direct relations to other persistent types, but allow embedded Collections
------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-593
                 URL: https://issues.apache.org/jira/browse/OPENJPA-593
             Project: OpenJPA
          Issue Type: Improvement
          Components: jdbc
    Affects Versions: 1.1.0
            Reporter: Michael Vorburger
             Fix For: 1.1.0


It's a pitty that @PersistentCollection(elementEmbedded = true) only works to 
to "depth 1", that is you can apparently not have an @Entity class A { 
@PersistentCollection(elementEmbedded=true) private Set<B> bs = new 
HashSet<B>(); ... } with @Entity class B again a  { 
@PersistentCollection(elementEmbedded=true) private Set<C> bs = new 
HashSet<C>(); ... }.

On OpenJPA 1.1, this leads to the error: 
"org.apache.openjpa.util.MetaDataException: "X.y<element:class Y>" is mapped as 
embedded, but embedded field "..." is not embeddable.  Embedded 
element/key/value types are limited to simple fields and direct relations to 
other persistent types."

The expected outcome would to have a schema with an SQL table A, an A_B (that 
works already!), and an A_B_C table (that doesn't work).

JPA 2.0 JSR 317 <http://jcp.org/en/jsr/detail?id=317> says "... support for 
collections of embedded objects, multiple levels of embedded objects ..."  so 
may this will be supported 'soon-ish' (that one liner may not refer to this 
exact use case)?

PS: This limitation has unfortunately turned into a show stopper for our use of 
OpenJPA, and made us look at another ORM which seems to support this kind of 
mapping.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to