Declaring the Home Interface

The home interface for a session bean declares the methods for creating and removing session objects. You can also use a remote home interface to get a reference to the bean’s EJBMetaData or the home handle. Both the EJBMetaData and the HomeHandle interfaces were described previously in Chapter 3, “EJB Concepts.” One restriction related to a session bean’s EJBMetaData is that you can’t call the getPrimaryKeyClass method or a RuntimeException will be thrown.

Unlike entity beans, you can’t declare finder methods or home methods for a session bean. Finder methods wouldn’t make sense for a session bean because a session object’s identity is hidden from the client. When a client needs to obtain a reference to a session ...

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.