Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Primary keys

 
Jayashree Mohan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we use equals() on a primary key class to determine if two keys refer to the same entity or should we use isIdentical() method only?
 
Greg Charles
Sheriff
Posts: 3002
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isIdentical() is for EJBObjects only. You can use equals to compare the primary key as long as both entity beans come from the same home. When you create a primary key class, you are required to implement equals so that this will work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic