This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Primary Key Class need to override hashCode() so that it can be stored in a Hashtable. Container internally stores all the entity beans it has in memory in a hashtable or some similar structure. Similarly,primary key class need to override equals method as container calls this method to compare two primary keys so as to determine if two cached entity beans represent the same data.
Snigdha<br />Sun Certified Programmer for the Java™ 2 Platform