users@glassfish.java.net

Re: Composite primary key and unidirectional manytomany relation

From: <glassfish_at_javadesktop.org>
Date: Thu, 03 May 2007 11:59:31 PDT

Hi Ketan,

the JPA specification states some rules for composite primary keys, please see JPA spec, $2.1.4. This means you should define your IdClass like:

public class UserSessionPK implements java.io.Serializable{
private String userId;
private String sessionId;
private String eventId;
....

-- markus.
[Message sent by forum member 'mf125085' (mf125085)]

http://forums.java.net/jive/thread.jspa?messageID=215425