----- Original Message -----
From: "Hemant Khandelwal" <[EMAIL PROTECTED]>
To: "A mailing list for Enterprise JavaBeans development"
<[EMAIL PROTECTED]>
Sent: Monday, March 12, 2001 11:23 AM
Subject: Re: Re: Modelling many to many relationships with EJB 2.0 compliant
containers?


There are two approaches for an application. One, using an existing
relational schema to define abstract persistence schema, and two, using
abstract persistent schema to create a relational schema. (Some application
server vendor tools provide you this second option)

Anyway for both the options, user has to specify a join table.

Managing many-to-many relationship with attributes, I will say, is not as
robust as it should be. One of the way you can get through it, is to break
the many-to-many relationship into one-to-many and many-to-one relationship.

I think a good way to "create" the correlation entity should be based on the
navigability of the relationship.

Regards,
Hemant
Server Team,
Pramati Technologies
www.pramati.com

----- Original Message -----
From: "Robert Nicholson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 12, 2001 10:01 AM
Subject: Re: Modelling many to many relationships with EJB 2.0 compliant
containers?


Where does the container learn the physical name of the correlation table or
is it simply created by the container at deployment time? It looks like for
CMP that there's never any references to the correlation entity in the
ejb-jar.xml file.

As you describe if you have additional attributes for your relationship you
have to map an entity bean to the a table. In this case. Who has
responsibility to invoke "create()" on the correlation beans home and at one
point is it made available in order to be able to call set methods to
populate the additional attributes?

If you go this way do you have to call create via addXXX(XXX) methods on the
source end of the 1-M relationship?

I'll check the archives now.

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Hemant Khandelwal
> Sent: Sunday, March 11, 2001 8:50 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Modelling many to many relationships with EJB 2.0 compliant
> containers?
>
>
> Hi Robert,
>
> The conatiner and Persistence Manager will tranparently manage the
> relationship.
>
> But there is an instance when an entity ejb needs to be defined for
> correlation entity. The case is when there are attributes of the relation.
> (Please check the archives for a previous discussion on the same thread.)
>
> Hemant
> www.pramati.com
>
> ----- Original Message -----
> From: "Robert Nicholson" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, March 12, 2001 8:42 AM
> Subject: Modelling many to many relationships with EJB 2.0 compliant
> containers?
>
>
> With the CMP offered by EJB 2.0 compliant containers. Is the correlation
> table completely transparently managed by the container?
>
> That is. Do I have to have an entity ejb for the correlation entity and
> .create it when I wish to create the assocation? Or can I do
> everything via
> references from the to one side of the relationship's entity? via. addXXX
> methods?
>
> Same question applies to EJB 1.1 containers too. How exposed is
> the "client"
> to the correlation table?
>
> ==================================================================
> =========
> 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".
>

===========================================================================
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".



Reply via email to