Skip to main content

using @Id getter methods

1 reply [Last post]
Anonymous

I tried to achieve the following design:

class AbstractOne implements Serializable { protected int id; }

class A extends AbstractOne { .. a.lot.of.code.here ... }

@Entity
class B extends A
{
@Id
@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
net.java.dev.cejug.classifieds.server.ejb3.entity.AdvertisementEntity]
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: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

Reply viewing options

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