The problem has to do with the EJB spec.  The spec says that the pk must be set in the ejbCreate method and then can't be changed.  The spec also says that cmr fields can not be set until ejbPostCreate.  Furthermore the spec only allows cmp-fields in compound pks.  I haven't thought of a way around this yet. I'm considering supporting the mapping a cmp-field to the same column as a cmr-field, but this opens a big can of worms.  Most of the interesting database fk mappings are not supported in JBossCMP yet (like not null foreign keys).  When I rewrite the cmr code the first time (I always expect to write code 3 times) I plan on supporting the interesting fk mappings.
 
-dain
-----Original Message-----
From: Ken Chang [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 10:49 AM
To: [EMAIL PROTECTED]
Subject: [JBoss-dev] fk in compound pk

this question bothers me for quite sometime now

is it true that if i want to have fk in compound pk, i need to ditch the cmr field for the fk so no fk relationship can be maintained (e.g. even the fk does not exsist as a pk in coresponding table, and container managed cascade delete wont be possible too)?

Ken

Reply via email to