Skip Headers

# Unknown Primary Key Class Support

Previous

Next

In special situations, you may choose not to specify the primary key class or the primary key fields for an entity bean with container-managed persistence. For example, if the entity bean does not have a natural primary key or you want the deployer to select the primary key fields at deployment time, you may choose to defer primary key type specification.

If this is the case, you must declare the type of the argument of the `findByPrimaryKey` method as `java.lang.Object` and you must also specify the primary key class (`prim-key-class`) in the deployment descriptor (`ejb-jar.xml`) as `java.lang.Object`.

TopLink now provides run-time support for such deferred primary key type specification.

For more information, see the EJB 2.1 specification, section 10.8.3.