But later in the same chapter we can see examples in section 2.4.1.3:The primary key class must be serializable.
(...)
The primary key class must define equals and hashCode methods.
Code: Select all
public class DependentId {
String name; // matches name of @Id attribute
long emp; // matches name of @Id attribute and type of Employee PK
}
Code: Select all
@Embeddable
public class DependentId {
String name;
long empPK; // corresponds to PK type of Employee
}