users@glassfish.java.net

RE: No ID column

From: Kenneth Clark <kenneth_at_rabiddog.co.za>
Date: Tue, 12 Jun 2007 20:04:42 +0200

The relationship is a true many to many, no other way to handle it.

 

As for the compound primary key I haven't tried that. Do you have a pointer
where I can read about it?

 

The object has been mapped as an entity

 

Thanks for the feed back

 

Kenneth Clark
System Architect / Lead Developer

Rabid Dog Laboratories T
Putting the art back into development

tel: +27 11 475 7409
mobile: +27 82 500 5090
e-mail: kenneth_at_rabiddog.co.za
website: http://www.rabiddog.co.za/

  _____

From: Gordon Yorke [mailto:gordon.yorke_at_oracle.com]
Sent: 12 June 2007 19:58
To: users_at_glassfish.dev.java.net
Subject: RE: No ID column

 

Have you mapped the table as an Entity? If you have mapped it as an Entity
then you must define a PK. In the case of a join table both FKs should be
combined to create a compound PK. Is the relationship a true many to many?
Have you considered mapping the join table as a secondary table in the case
of one to many relationship?

--Gordon

-----Original Message-----
From: Kenneth Clark [mailto:kenneth_at_rabiddog.co.za]
Sent: Tuesday, June 12, 2007 1:23 PM
To: users_at_glassfish.dev.java.net
Subject: No ID column

I have a many to many table that designates the relationships between two
entities and I get the following error:

It should define either an @Id, @EmbeddedId or an @IdClass.
javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle
TopLink Essentials - 2.0 (Build b41d-beta2 (04/24/2007))):

 

The table contains no primary keys as it doesn't require any.

 

Anyone have any ideas?

 

Kenneth Clark
System Architect / Lead Developer

Rabid Dog Laboratories T
Putting the art back into development

tel: +27 11 475 7409
mobile: +27 82 500 5090
e-mail: kenneth_at_rabiddog.co.za
website: http://www.rabiddog.co.za/