• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About EJBObject.isIdentical()...

 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJBObject.isIdentical(Object o) returns true if two EJBObject stubs refer to the same bean's entity.

My doubt is...In the real world, when would you use this method?
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would use this method whenever you need to assess whether two references to an entity bean refer to the same entity bean or not.

As the behavior of the equals and hashCode methods is not guaranteed in a distributed environment, you need the isIdentical method for performing the same kind of job you would do with the equals method in a normal Java program. You can also check out the primary key of the entity bean and base your decision on that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic