This should be in the database-persistence forum.
And the answer is NO. In the future I will allow a cmr-field to be mapped to a cmp-field. This will require read-only relationships and a reordering of create and delete statements. It will be a while.
Dain, thanks for the response. I had to chuckle at your remark "This should be in the database-persistence forum", since I was on the verge of suggesting that somebody rename the EJB forum to "EJB design" to emphasize the intent, since at least half of the postings here are not design questions.
My question was whether there was a design solution using standard EJB 2.0, irrespective of the EJB container. I understand the answer to be:
There is no standard solution. A solution would require mapping a cmr-field to a cmp-field. That is a vendor extension that JBoss, and probably other vendors, don't yet support.
That seems to be a big limitation in EJB 2.0, since it is not unusual for a real-world database schema to include a foreign key attribute in an entity table primary key.
I must be missing something. Surely others face this situation, but I could not find the issue addressed in the spec or any EJB forum, including Sun or ServerSide.
A work-around is to invent a redundant id field for the primary key, but that is not always possible for a legacy db.
is this function implemented in JBOss 4 ??