[ 
https://issues.apache.org/jira/browse/OPENJPA-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-1361.
--------------------------------------
    Resolution: Fixed

Already fixed on master: JavaTypes.getTypeCode maps non-Serializable interfaces 
to PC_UNTYPED (JavaTypes.java:194-197), and 
MappingRepository.useInverseKeyMapping (MappingRepository.java:1146) has 
accepted PC_UNTYPED mapped-by fields since a873065db (OPENJPA-1686, on master), 
so 'bad-mapped-by' is no longer thrown there. Closing.

> 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
>            Priority: Major
>         Attachments: case-sandbox-property-access.zip, 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 was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to