O'Reilly logo

Special Edition Using Java™ 2 Enterprise Edition by Mark Wutka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an Entity Bean with Bean-Managed Persistence

An entity bean looks just like a session bean in that you still create Home and Remote interfaces as well as an implementation class. One of the differences is that the Home interface can have finder methods, remove methods, and other utility methods. The other difference is that the implementation class must have several methods that a session bean doesn't need.

As with the session bean, it's best to start by creating the Home and Remote interfaces, because if you can't define these, you don't know yet what the bean is supposed to do. Suppose you want to create a simple address book application. You can store the name, address, and phone number of each person by creating a Person entity bean. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required