Implementing Finder Methods

When a client calls a finder method, the container calls your corresponding ejbFind method. The most important concept here is that you’re only responsible for returning the primary key values that match the criteria of a finder from an ejbFind method. The container responds by returning component interface references to the client, but it doesn’t have to activate any entity object located by the finder until the client calls a business method on its component interface. This means that simply invoking a finder method that applies to a particular entity object doesn’t cause ejbLoad to be called for that object.

The simplest finder method is findByPrimaryKey. Given the preceding discussion, the only responsibility ...

Get Special Edition Using Enterprise JavaBeans™ 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.