Hi Robert,
I would like you to take this solution with a caveat. I also request to wait
for the final specification before proceeding further on CMP component
contract in EJB2.0.
In the model the following entities are present.
Person
Door
PersonDoorAccess (I call this entity because of its attributes,
lastAccessed, PIN etc.)
Person and door seems to be good candidate for modeling them as entity
beans.
Answering some of these questions will help you in modeling the
PersonDoorAccess entity.
1. What type of relationship - many-to-one bidirectional or many-to-one
unidirectional - exists between PersonDoorAccess entity and Person entity ?
2. Similarly what type of relationship - many-to-one bidirectional or
many-to-one unidirectional - exists between PersonDoorAccess entity and
Door entity ?
The directionality of the relationship is important here as it will help in
determining the dependency of PersonDoorAccess entity with other two
entities. While determining the directionality of the relationship, think
about navigability; whether Person entity or Door entity, or both always
needs to navigate to PersonDoorAccess entity in the application.
With these questions in mind, lets consider the example in section 9.4.13 of
Proposed Final Draft of EJB2.0 specification.
I consider the relationship between Order and Product entity as
many-to-many. An Order can be placed for many products, and a Product can be
included in many orders. In this example, quantity of product ordered, etc
are attributes of the many-to-many relationship. The example, in the PFD,
model the relationship using LineItem entity and defining
many-one-bidirectional relationship and many-to-one unidirectional
relationship.
Regards,
Hemant Khandelwal
Server Team,
Pramati Technologies
www.pramati.com
----- Original Message -----
From: "Robert Krueger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 20, 2001 12:42 AM
Subject: Modeling relationships with attributes with EJB2.0 CMP
Hi,
after reading through chapter 9 of EJB 2.0pfd (chapter on CMP) I have some
rather fundamental questions.
In our datamodels we frequently encounter relationships that have
attributes themselves. Let's take the hypothetical example of a security
system that models doors of a building and people's access rights. Every
person gets an individual PIN for each door (sorry, couldn't come up with a
less artificial example ;).
Say I have an entity Person and an Entity Door and a relationship
PersonDoorAccess with multiplicity many-many. Then things like lastAccessed
and PIN would be modelled as an attribute of that relationship. I don't see
any way of doing that using EJB2.0 CMP except for modeling the relationship
PersonDoorAccess as an entity itself.
Is there an obvious reason why relationship attributes don't seem to be
supported? Is my modeling approach wrong?
It would be great if anyone who's closer to the specifcation process could
enlighten me where my mistake is.
Thanks in advance,
Robert
(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de
===========================================================================
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".
===========================================================================
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".