This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Regarding overriding of hashcode() and equals() method in Hibernate. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Regarding overriding of hashcode() and equals() method in Hibernate." Watch "Regarding overriding of hashcode() and equals() method in Hibernate." New topic
Author

Regarding overriding of hashcode() and equals() method in Hibernate.

Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Hi,
I want to know that Why do we override hashcode() and equals() methods in domain object?
And I saw in only certain cases we override them and not in all domain classes,so When should we override them in domain?
Please answer my queries.
Thanks
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

Does this answer your question ?


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Regarding overriding of hashcode() and equals() method in Hibernate.
 
Similar Threads
LinkedHashSet
Equals and hashcode
if we override hashCode method is compulsary to override equals method and viseversa.
Where and why to override hashcode() and equals() methods in hibernate domain class?
enums