Hi!
Basically you need a custom Primary Key class when you have specified a
composite primary key(i.e when a combination of more than one field in a table is used as a primary key) for a table in the database.
for further reference see:-
Book Name:-Sams teach yourself
J2EE in 21 days
chapter 6-Entity EJB's
Page 205.
Topic: Custom Primary Key Classes