What is a Primary Key of an Entity Bean With Container-Managed Persistence?
Each entity bean instance has a primary key that uniquely identifies it from other instances. You must declare the primary key (or the fields contained within a complex primary key) as a container-managed persistent field in the deployment descriptor. All fields within the primary key are restricted to the following: • primitive object types; • serializable types; • types that can be mapped to SQL types. You can define a primary key in one of the following ways: • Define a simple primary key made up of a single, well-known serializable Java primitive or object type. The primary key variable that is declared within the bean class must be declared as public (see “Configuring a Primary Key Field for an EJB 2.1 Entity Bean With Container-Managed Persistence”). • Define a composite primary key class made up of one or more well-known serializable Java primitive and object types within a