Jordan Thomas wrote:
Hi,

How do I create a compound Primary key for my ejb's with XDoclet? I tried
using the @ejb.pk-field tag on two fields to no avail. Essentially, I want
to have a relation and an ID form the key.
Ah, the old "FK in PK" problem. This is not a xdoclet fault, but an EJB fault. You bean must have it's primary key defined by the time ejbCreate() returns, but relations can't be set in ejbCreate(). That way, according to the current EJB specification, you can't have foreign keys as part of your primary key.

This sucks, I know, and most app server vendors know and provide some proprietary way to circumvent this.

On the XDoclet side, the restrition is that @ejb.pk-field must be used on a CMP field, and a relation is not a CMP field. That must be why you're having problems adding your relation to the primary key.

Solutions for your problem? I don't know. We could change the xdoclet behavior so it now looks for @ejb.pk-field in relations too, but then we still have the problem with the EJB specification.

--
Pazu



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to