Skip to main content

using @Id getter methods

1 reply [Last post]

I tried to achieve the following design:

class AbstractOne implements Serializable { protected int id; }

class A extends AbstractOne { .. ... }

class B extends A
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
public int getId() {
return id;

Then I tried to deploy the application on Glassfish, but I got an exception:

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

Seems to be a killer issue in my design :( please help...

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-11-02
Points: 0