Chapter 21. Entity Beans

Our final topic in the book is the use of entity beans. Entity EJBs represent persistent data, which most commonly resides in an SQL database that will be accessed via JDBC. This is not a requirement by any means—the data could reside in any file structure the developer chooses—but most EJB container providers provide tools and utilities that greatly simplify the use of the most common data sources, while supporting something more esoteric is left completely to the developer.

In our example application, we have two candidates for making entity beans; the Team class and the Game class. We don't dynamically create new teams during the year, and although the data for a team changes, the changes do not really need to be persisted—as ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.