Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 37402 invoked from network); 27 Oct 2010 20:59:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Oct 2010 20:59:40 -0000 Received: (qmail 4836 invoked by uid 500); 27 Oct 2010 20:59:40 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 4795 invoked by uid 500); 27 Oct 2010 20:59:40 -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 4787 invoked by uid 99); 27 Oct 2010 20:59:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Oct 2010 20:59:40 +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; Wed, 27 Oct 2010 20:59:39 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9RKxJKt024003 for ; Wed, 27 Oct 2010 20:59:19 GMT Message-ID: <25206896.106941288213159738.JavaMail.jira@thor> Date: Wed, 27 Oct 2010 16:59:19 -0400 (EDT) From: "Fay Wang (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Resolved: (OPENJPA-1857) Wrong exception is thrown when JoinColumn annotation is not incorrectly specified In-Reply-To: <16202171.102091288196302927.JavaMail.jira@thor> 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-1857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fay Wang resolved OPENJPA-1857. ------------------------------- Resolution: Fixed > Wrong exception is thrown when JoinColumn annotation is not incorrectly specified > --------------------------------------------------------------------------------- > > Key: OPENJPA-1857 > URL: https://issues.apache.org/jira/browse/OPENJPA-1857 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 2.1.0 > Reporter: Fay Wang > Priority: Minor > Fix For: 2.1.0 > > > Consider the following scenario. Note that the referencedColumnName in Dependent5a.java does not exist in the target table. Currently OpenJPA throws PersistenceException. The correct exception should be ArgumentException indicating that "org.apache.openjpa.persistence.enhance.identity.Dependent5a.emp" defines a target of "xFIRSTNAME" for column "FIRSTNAME", but that target does not exist in table "Employee5". > @Entity > @IdClass(DependentId5.class) > public class Dependent5a implements Serializable { > private static final long serialVersionUID = 1L; > @Id > String name; > > @Id > @JoinColumns({ > @JoinColumn(name="FIRSTNAME", referencedColumnName="xFIRSTNAME"), > @JoinColumn(name="LASTNAME", referencedColumnName="yLASTNAME") > }) > @ManyToOne > Employee5 emp; > ... > } > @Entity > public class Employee5 implements Serializable { > private static final long serialVersionUID = 1L; > @EmbeddedId > EmployeeId5 empId; > ... > } > @Embeddable > public class EmployeeId5 implements java.io.Serializable { > String firstName; > String lastName; > ... > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.