Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 27893 invoked from network); 9 Sep 2008 16:56:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 16:56:58 -0000 Received: (qmail 84207 invoked by uid 500); 9 Sep 2008 16:56:55 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 84183 invoked by uid 500); 9 Sep 2008 16:56:55 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 84172 invoked by uid 99); 9 Sep 2008 16:56:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 09:56:55 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists+1214986160035-208411@n2.nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 16:55:56 +0000 Received: from tervel.nabble.com ([192.168.236.150]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Kd6Vu-000080-Q7 for users@openjpa.apache.org; Tue, 09 Sep 2008 09:56:26 -0700 Message-ID: <1220979386798-1078084.post@n2.nabble.com> Date: Tue, 9 Sep 2008 09:56:26 -0700 (PDT) From: ericp56 To: users@openjpa.apache.org Subject: PK Problem, mismatched property MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: eric.phetteplace@twcable.com X-Virus-Checked: Checked by ClamAV on apache.org I have three tables: Question id long (PK) description string etc. Survey id long (PK) surveydate Date etc. QuestionResults SurveyResultsID (FK) QuestionID (FK) Answer Here's my class that won't persist, because of errors (to follow): @Entity @Table(name="QuestionResults") @IdClass(QuestionResultsPK.class) public class QuestionResults implements Serializable { private int answer; @Id @ManyToOne @JoinColumn(name="QuestionID") private QuestionProp questionid; @Id @ManyToOne @JoinColumn(name="SurveyResultsID") private SurveyResults surveyresultsid; ... Here's the PK class: @Embeddable public class QuestionResultsPK implements Serializable { @Column(name="SurveyResultsID", insertable=false, updatable=false) private SurveyResults surveyresultsid; @Column(name="QuestionID", insertable=false, updatable=false) private QuestionProp questionid; ... Here's the error raised: 12:33:02,703 ERROR [Survey] Exception in WriteQuestionResult 12:33:02,703 ERROR [Survey] org.apache.openjpa.persistence.ArgumentException: The id class specified by type "class com.abc.ivr.survey.QuestionResults" does not match the primary key fields of the class. Make sure your identity class has the same primary keys as your persistent type, including pk field types. Mismatched property: "questionid" at org.apache.openjpa.meta.ClassMetaData.validateAppIdClassPKs(ClassMetaData.java:1983) at org.apache.openjpa.meta.ClassMetaData.validateAppIdClass(ClassMetaData.java:1897) I ported this code from a Swing/Tomcat application, but I was using OpenJPA 1.1. Now I am using OpenJPA 1.2 on Geronimo (a 2.1.4 build) Any suggestions? Thanks, Eric -- View this message in context: http://n2.nabble.com/PK-Problem%2C-mismatched-property-tp1078084p1078084.html Sent from the OpenJPA Users mailing list archive at Nabble.com.