Dave,

We still don't see eye-to-eye, and I think I made the problem worse with my
example.

I think the most common type of relationship will be something like 'a cd
has an artist' or 'a cd has a publisher.'  In this cases, the foreign key
for the  artist or publisher would be just another column in the cd table.
So we would have something like:

        String idbn pk
        String title
        ...
        Oid cd_artist fk
        Oid cd_publisher fk

The oid is a place holder for what ever the pk for cd and artist (don't let
it confuse you).  I will argue that this is the most common relationship
type and is auto created by the system.  

Now your mapping is very different from what we have above.  Your mapping
mapps a foreign key to one of the pk columns (multi-key).  This is a very
difficult mapping because of the way the cmp engine is architected.  The CMP
engine is field oriented as apposed to column oriented.  A field can map to
multiple columns (a feature that existed in jaws).

Follow so far?

Now each entity is composed of a collection of cmp field field objects and a
collection of foreign key fields (or relation table key fields). I'm only
going to address foreign key fields here.  When the system starts it
initializes the cmp fields for every entity. After that is complete it
initializes the relationships.  For each cmr field in an entity, it locates
the related entity and creates a set of foreign-keys that are a copy of the
related entitie's pk field(s).

Still with me?

The problem you mapping presents is you want to use a field for both an
entity cmp and a relation foreign key field.  In the current code these
fields are different object.  The caching code is also field oriented, so
you would end up with two distinct caches of the code. Which could be a big
problem.

Ok let's take a step back and examine the mapping from the spec perspecitve.
Using a pk field as a relationship foreign key presents a problem because
the spec requres that a pk never change after ejbCreate but also requires
that a relationship can not be set until ejbPostCreate.  This leads to the
question, how exactly are you going to set the relationship?

Any way, I don't think any of the above text is that important.  Although I
think what you ask will make your code not spec compliant, I also think this
type of mapping is important.  I will look into adding support for this type
of mapping, but it won't happen soon.  I am focusing on the features
required for spec compliance.  Then I am going to add performance
enhancements.  And finally additional features.

Ok that was a lot of babble.  I need to stop writting emails before I get my
first cup of coffee.

-dain

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to