Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@Transient and hashCode/equals ?

 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should transient-fields(@Transient) of a Entity-Class
should also be in hashCode/equals-Method?
 
Javid Jamae
Author
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you don't want to include those in the equals/hashCode methods. @Transient fields are not persisted, so a persistent object and a transient object might be equal even though their @Transient fields are different.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic