The PlayerEJB Code

The PlayerEJB entity bean represents a player in a sports league. Like any entity bean with container-managed persistence, PlayerEJB needs the following code:

  • Entity bean class (PlayerBean)

  • Local home interface (LocalPlayerHome)

  • Local interface (LocalPlayer)

The source code for this example is in the j2eetutorial/examples/src/ejb/cmproster directory. To compile the code, go to the j2eetutorial/examples directory and type ant cmproster.Asample RosterApp.ear file is in the j2eetutorial/examples/ears directory.

Entity Bean Class

For container-managed persistence, the code of the entity bean class must meet the syntax requirements. First, the class must be defined as public and abstract. Also, the class must implement the following: ...

Get J2EE™ Tutorial, The 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.