users@glassfish.java.net

RE: No ID column

From: Kenneth Clark <kenneth_at_rabiddog.co.za>
Date: Tue, 12 Jun 2007 19:51:28 +0200

Sorry just to follow up, the verifier returns this message

 

Exception Description: Entity class [class xxx] has no primary key
specified. It should define either an @Id, @EmbeddedId or an @IdClass.

 

Below are the fields

  @ManyToOne

  @JoinColumn(name = "customer_id", referencedColumnName = "id")

  private Customer customer;

 

  @ManyToOne

  @JoinColumn(name = "company_type_id", referencedColumnName = "id")

  private CompanyType companyType;

 

Does anyone have any input or direction? Am I going to have to create a
primary key for this table. I cannot see the point of the primary key other
than to circumvent this error

 

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: Kenneth Clark [mailto:kenneth_at_rabiddog.co.za]
Sent: 12 June 2007 19:23
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/