openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Vorburger" <>
Subject RE: PK Problem, mismatched property
Date Tue, 09 Sep 2008 17:45:14 GMT
I'm not sure that's the problem, but have you tried not putting any
@Column onto the QuestionResultsPK ?

Otherwise, browsing the code around that
ClassMetaData.validateAppIdClassPKs may help you understand better what
the message is trying to tell you?

-----Original Message-----
From: ericp56 [] 
Sent: mardi, 9. septembre 2008 18:56
Subject: PK Problem, mismatched property

I have three tables:
id long (PK)
description string
id long (PK)
surveydate Date
SurveyResultsID (FK)
QuestionID (FK)

Here's my class that won't persist, because of errors (to follow):

public class QuestionResults implements Serializable {

	private int answer;

	private QuestionProp questionid;

	private SurveyResults surveyresultsid;

Here's the PK class:

public class QuestionResultsPK implements Serializable {

	@Column(name="SurveyResultsID", insertable=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] <openjpa-1.2.0-r422266:683325 fatal user
org.apache.openjpa.persistence.ArgumentException: The id class specified
by type "class" 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:

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?


View this message in context:
Sent from the OpenJPA Users mailing list archive at


 This email and any files transmitted with it are CONFIDENTIAL and intended
  solely for the use of the individual or entity to which they are addressed.
 Any unauthorized copying, disclosure, or distribution of the material within
  this email is strictly forbidden.
 Any views or opinions presented within this e-mail are solely those of the
  author and do not necessarily represent those of Odyssey Financial
Technologies SA unless otherwise specifically stated.
 An electronic message is not binding on its sender. Any message referring to
  a binding engagement must be confirmed in writing and duly signed.
 If you have received this email in error, please notify the sender immediately
  and delete the original.

View raw message