• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is Hashing In EJB PK Class  RSS feed

 
Bish Ach
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all Plz make the Hashing Concept In EJB PK Class.. Why it is needed? And how it does its work?
Thanx In Advance
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you need to do (this is a MUST) is provide implementation to the hashCode() method in the Primary Key class. You would retrun an integer value for the hashCode of the primary-key.
The hashCode() method is one of two methods you MUST implement in the Primary Key cassl of an Entity Bean. The other method is the equals() method.
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The short answer is that it's a unique identifier for the instance. For more information on hashing and it's purpose, look at java.util.HashMap - or lookup HashMap in a good data structures book
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!