I got an Eclipse error with : @EmbeddedId
.
This is the entity :
@Entity
@Table(name = "PERSON")
public class Person implements Serializable {
@EmbeddedId
private PersonPK PersonPK;
@Column(name = "AGE")
private int age;
}
And the embeddable class :
@Embeddable
public class PersonPK implements Serializable {
@Column(name = "FIRSTNAME")
private String firstName;
@Column(name = "LASTNAME")
private String lastName;
public PersonPK() {
}
}
Eclipse show me this error : PersonPK is not mapped as an embeddable
Can you tell me why and how to fix that ?