Just to try to review the requirements: prim-key-class is *always*
required, and prim-key-field is required for CMP entity beans that use a
simple primary key.
For CMP beans that use a complex primary key, all the fields of
the primary key must be public and non-static. They must have the same
names as fields in the bean implementation class, and those fields must
also be public and non-static. The PK fields in the bean implementation
must be declared as CMP Fields in ejb-jar.xml, as well.
You should not declare a field in the bean implementation that has
the type of the bean's primary key - you must instead use multiple
individual fields that correspond to the fields of the primary key, as
above. Or at least, if you do declare such a field, it cannot be a
container-managed field and it does not replace the individual
container-managed fields that are required.
Let's see... Your primary key class must be serializable and
public. That's about all I can think off off the top of my head, but the
spec is of course the final authority.
I think there may be a few things to add to the verifier here.
I'll go have a look.
Aaron
On Thu, 14 Sep 2000, Sebastien Alborini wrote:
> Sylko Olzscher wrote:
> >
> > jBoss
> >
> > To realize an one-to-many relation I need a primary key consists of two
> > Strings/VARCHARs: _id and _idforeign. I testet some CMP - EJBs with a single
> > key and a primary key class. It works well, but I was a little confused,
> > because it's required to fill the <primkey-field>_id</primkey-field> AND the
> > <prim-key-class>demo.CkeyPK</prim-key-class> entry in the EJB1.1 descriptor.
> > Otherwise it doesn't work.
> >
> > Now I tried hard to work with a combined key, but deployment failed. (Sorry,
> > but the traceback is not so usefull).
> >
> > Has anyone an idea how to fix this problem.
> > Thanks,
> > Sylko
> >
>
> Hi,
>
> Have you had a look at the examples in testbeans.jar? (the source is
> available by cvs checkout zola or
> http://www.jboss.org/zip_archives/zola-cvs-sources.zip )
>
> - EnterpriseEntity is an entity with a simple pk (String)
> - EntityPK is an entity with a complex PK
>
>
> Sebastien
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]