Enhancer fails when using OneToMany.mappedBy on bidi one-to-many relationship 
when using interface references on many side
--------------------------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-1361
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1361
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 1.2.1
            Reporter: Matthew T. Adams


Synopsis:  bidirectional one-to-many relationship where the one side references 
the objects on the many side using a concrete class reference and the many side 
references the object on the one side using an interface reference.  When 
specifying the mappedBy property of the @OneToMany annotation, the OpenJPA 
enhancer throws the error:

Collection field "example.model.Concrete.pebbles" declares that it is mapped by 
"example.model.Pebble.buildingMaterial", but this is not a valid inverse 
relation.

When I remove the mappedBy property, everything works fine, except that OpenJPA 
creates an extra join table (Concrete_Pebble) where it shouldn't, IMHO.  I have 
two questions, an answer to either one of which will suffice:

1. Why can't I use mappedBy in this scenario?
2. How do I annotate things with @JoinColumn or similar that will allow me to 
not have a join table and only the reference from Pebble back to its 
BuildingMaterial?

I'll attach test case next.

-- 
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