openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maarten Van Puymbroeck (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1253) JoinColumn annotation not allowed in conjunction with *ToMany annotation
Date Wed, 12 May 2010 15:08:40 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12866592#action_12866592
] 

Maarten Van Puymbroeck commented on OPENJPA-1253:
-------------------------------------------------

Jimmy,

I believe there is no fix for versions 1.* because the JPA 1.0 standard does not seem to support
JoinColumn on a OneToMany. (See Fay Wang's initial comment).

I also have this problem because I have moved from another JPA implementation that does support
this, but that is against the standard.

> JoinColumn annotation not allowed in conjunction with *ToMany annotation
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-1253
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1253
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 2.0.0-M1, 2.0.0-M2, 2.0.0-M3
>            Reporter: Rick Curtis
>            Assignee: Fay Wang
>             Fix For: 2.0.0-M3
>
>
> I receive the following exception if I have an Entity with a One(Many)ToMany relationship
with another Entity. 
> <openjpa-2.0.0-SNAPSHOT-r422266:805588 fatal user error> org.apache.openjpa.persistence.ArgumentException:
You have supplied columns for "....Entity", but this mapping cannot have columns in this context.
> To recreate the failure, add a @JoinColumn annotation to one of the *ToMany relationships
in org.apache.openjpa.persistence.jdbc.annotations.AnnoTest1. 
> example:
>     @MapKey(name = "basic")
>     @OneToMany(mappedBy = "oneManyOwner")
>     @JoinColumn(name = "asdf")
>     protected Map<String, AnnoTest2> inverseOwnerMapKey = new HashMap();
> Then run:
> trunk\openjpa-parent\openjpa-persistence-jdbc>mvn test -Dtest=org.apache.openjpa.persistence.jdbc.annotations.TestOneToMany

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


Mime
View raw message