Unknown primary-key class

When writing an entity bean, the minimum requirements usually include a primary-key class. However, in some cases you might choose not to specify the primary-key class for an entity bean with container-managed persistence (CMP).

Perhaps there is no obvious primary key, or you want to allow the deployer to select the primary key fields at deployment time. The primary key type is usually derived from the type used by the database system that stores the entity objects, and you might not know what this key is.

So, the unknown key type is actually a type chosen at deployment time, making it changeable each time the bean is deployed. Your client code must deal with this key as type Object.

Currently, WebSphere® Application Server supports top-down mapping and enables the deployer to choose String keys generated at the application server. For an example of how to use this function, see the Samples Gallery.




Related concepts
Enterprise beans
Related tasks
Developing enterprise beans
Related reference
Enterprise bean development best practices
Reference topic    

Terms of Use | Feedback

Last updated: Oct 20, 2010 9:57:58 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-base-dist&topic=unprikey
File name: rejb_unprikey.html