Hi Robert,
I think there could be another approach to what you
described, and this is what we (at our organization)
use. (ejb spec 1.1 though ... i am looking at the 2.0
but at the moment i don't see any solution there)
This is addition to what Hemant Khandelwal
(from Pramati) described about determining
the directionality of the relationship & navigability.
but once you do the above, what's described
below could be useful.
In most cases, your entity beans would be just a
view of the database tables i.e. the persistence layer
itself.
so at the DB level and the entity bean level, you would
the entities Door, Person and PersonDoorAccess.
The PersonDoorAccess would have the attributes
PIN, lastAccessed plus anything else you might need.
Our approach is to eliminate the PersonDoorAccess
from the client view (this exists on the server side
though). Thus you would (in most cases) have a
Session Bean which acts as a facade to the
PersonDoorAccess entity bean. This session
bean would in fact model the many-to-many
relationship between person and door using the
PersonDoorAccess entity internally while shielding
it from view of a client thus providing an OO view.
At the DB level, there is no way out except for a
third table to model the many-to-many relationship.
of course you could use an object db instead of
an rdbms but i doubt you'd want that. :)
-krish
----- Original Message -----
From: Robert Krueger <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 7:12 PM
Subject: Modeling relationships with attributes with EJB2.0 CMP
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".