Q&A

Q1:What are the differences between a business method and a home method?
A1: The component interface defines the business methods. For entity beans, the home interface defines home methods. Home methods contain business logic that is not specific to an entity bean instance. These methods are analogous to static methods.

In contrast, the logic in a business method applies to a single entity bean, an instance with a unique identity. Because a home method is not specific to an entity bean instance, the entity instance is not associated with any unique identity during home method invocation. So, a home method implementation cannot access an entity bean's persistence state (instance variables).

Get Sams Teach Yourself EJB in 21 Days 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.