Chapter 7. Entity Beans

An Entity Bean is an abstraction representing a state-laden class whose instances are stored in a persistence mechanism such as a relational database. Generally speaking, if a class’s state (that is, its attributes) is more important than its behavior (that is, its methods), then the class is amenable to being implemented as an Entity Bean. BookEaz’s system contained several Entity Beans, including Book, ShoppingCart, ShoppingItem, Order, and LineItem. These abstractions from BookEaz’s business domain all pass the “state is more important than behavior” litmus test.

Every instance of an Entity Bean has a unique identity that ...

Get EJB™ 2.1 Kick Start 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.