• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when an entity is missing, which exception to throw

 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When an entity is missing, in what cases will client get a NoSuchEntityException and when will client get an ObjectNotFoundException? What is the difference?
Thanks
 
Inesh Hettiarachchi
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
the ObjectNotFoundException is thorown from a finder method that is declaired to return a single entity.
but the NoSuchEntityException is thrown from business methods or container callback methods (ejbLoad,ejbStore) when the entity is deleted from the database.
inesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic