The container throws the FinderException to indicate that something went wrong while finding requested entity object invoked by a client.
If an entity is not found, the client gets an ObjectNotFoundException in the case of a single-entity finder and an empty Collection (and no exception) in the case of a multiple-entity finder.
- single-entity finder=====>>>> javax.ejb.ObjectNotFoundException
- multiple-entity finder=====>>>> Empty Collection
FinderException is used to report a failure to find the requested
EJB objects. Ans that's why we must need to add it in throws clause of finder method signature.
We must include this exception in the throws clause of all find methods that we declare in the entity bean's home interface and all the ejbFind (in the case of a BMP bean) and ejbSelect methods that we declare in the bean class.
i.e.
findXXX() of Entity Bean's Home interface
ejbFindXXX() of Entity Bean class
ejbSelectXXX() of Entity Bean class
Thanks,
Mahesh
-------
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, (
SCEA Part I preparing......)