Defining the Primary Key Class

An entity object must have an associated primary key object. This isn’t surprising given that an entity bean instance typically corresponds to a row in a relational database table. Even if you’re using an entity bean to represent some other type of data, you still have to associate a primary key with each unique element of that data so the container can keep track of everything. Part of your job as a bean provider is to identify the primary key class for an entity bean within its deployment descriptor. This is true no matter which persistence management approach you choose.

Note

This section isn’t intended to imply that all the data associated with an entity bean comes from a single table in a database. More often, ...

Get Special Edition Using Enterprise JavaBeans™ 2.0 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.