You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Matthew T. Adams (JIRA)" <ji...@apache.org> on 2009/10/23 19:55:59 UTC
[jira] Updated: (OPENJPA-1361) Enhancer fails when using
OneToMany.mappedBy on bidi one-to-many relationship when using interface
references on many side
[ https://issues.apache.org/jira/browse/OPENJPA-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthew T. Adams updated OPENJPA-1361:
--------------------------------------
Attachment: case-sandbox.zip
Test case.
> 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
> Attachments: case-sandbox.zip
>
>
> 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.