Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 3934 invoked from network); 16 Dec 2010 20:55:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Dec 2010 20:55:21 -0000 Received: (qmail 82213 invoked by uid 500); 16 Dec 2010 20:55:21 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 82173 invoked by uid 500); 16 Dec 2010 20:55:21 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 82165 invoked by uid 99); 16 Dec 2010 20:55:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Dec 2010 20:55:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Dec 2010 20:55:21 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBGKt0DQ012337 for ; Thu, 16 Dec 2010 20:55:00 GMT Message-ID: <27061389.165421292532900784.JavaMail.jira@thor> Date: Thu, 16 Dec 2010 15:55:00 -0500 (EST) From: "Kevin Sutter (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1607) Using unidirectional one-to-many target foreign key throws exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-1607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972207#action_12972207 ] Kevin Sutter commented on OPENJPA-1607: --------------------------------------- Okay, I just reproduced it... org.apache.openjpa.persistence.ArgumentException: You have supplied columns for "org.apache.openjpa.persistence.compat.EntityC_B1MJT.bi1mjt", but this mapping cannot have columns in this context. But, I had to change my persistence.xml to reference the 1.0 xsd instead of the 2.0 xsd: If I use the 2.0 xsd, then everything works as expected. When I look at the original testcase posted, there were two persistence.xml files in the package. One had 1.0, the other had 2.0. So, depending on which one was referenced, it could cause the error. Can you check which xsd is being utilized in your respective environments? The reason for the difference is that the OneToMany with FK was not supported in JPA 1.0. Thus, the check for the condition and the error message. But, with JPA 2.0, this is FK is supported. My take is that is working as designed, as long as the originators of the JIRA can verify the proper xsd is being used. Thanks, Kevin > Using unidirectional one-to-many target foreign key throws exception > -------------------------------------------------------------------- > > Key: OPENJPA-1607 > URL: https://issues.apache.org/jira/browse/OPENJPA-1607 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 2.0.0-beta3 > Reporter: Oliver Ringel > Attachments: openjpa-1607.tar > > > Using this simple unidirectional relationship > @OneToMany > @JoinColumn(name = "DEPARTMENT_ID") > private Set employees; > causes to the following exception > org.apache.openjpa.persistence.ArgumentException: You have supplied columns for "com.example.Department.employees", but this mapping cannot have columns in this context. > Unidirectional one-to-many target foreign key relationship should be supported in JPA 2.0. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.