@Entity @Table(name = "TABLE_NAME") @IdClass(PK.class) public class TableName implements Serializable{ @Id @Column(name="ID1") private String id1; @Id @Column(name="ID2") private String id2; @Column(name="OTHER") private String other; public class PK implements Serializable { private String id1; private String id2; }