I think for CMP you need to need to create a primary key object in which you set your relevent attributes then pass that the ejbcreate. The persistant fields you regard as the primary key are not the same as what the container regards as the primary key - you therefor dont link the persistant fields to the primary key but let the container handle it.
This is a quote from SUN's J2EE TUTORIAL
Generating Primary Key Values
For some entity beans, the value of a primary key has a meaning for
the business entity. For example, in an entity bean that represents a
phone call to a support center, the primary key might include a time
stamp that indicates when the call was received. But for other beans,
the key's value is arbitrary--provided that it's unique. With
container-managed persistence, these key values can be generated
automatically by the EJB container. To take advantage of this feature,
an entity bean must meet these requirements:
In the deployment descriptor, the primary key class is defined as a
java.lang.Object. The primary key field is not specified.
In the home interface, the argument of the findByPrimaryKey method
must be a java.lang.Object.
In the entity bean class, the return type of the ejbCreate method must
be a java.lang.Object.
In these entity beans, the primary key values are in an internal field
that only the EJB container can access. You cannot associate the
primary key with a persistent field or any other instance variable.
However, you can fetch the bean's primary key by invoking the
getPrimaryKey method, and you can locate the bean by invoking its
findByPrimaryKey method.
--------------------
For more on this take a look at http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/CMP8.html#72960quoted from J2EE Tutorial (by Sun) "Container-Managed Persistence
Examples" Chapter, Page 8
Hope that helps
Gareth
Chat with friends online - download MSN Messenger today. =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".