Select Methods

Entity beans introduce a new set of methods that use EJB QL queries, namely that of select methods. These are like finder methods, in that their purpose is to return data from the persistent data store using container generated functionality.

Select methods are provided to allow bean developers to query the persistent store from within a bean without exposing that query to client code through a finder method. Select methods must be used when a bean needs to query the database for data stored in CMP or CMR fields. Select methods can only be called by the bean itself, so they act as helper methods.

Select methods are defined as abstract methods with the Entity bean implementation and have a name prefix of ejbSelect. The Agency case ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition 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.