Sanjay !!

Consider this approach and lemme know if it would work better !!!


why dont u have table1, table 2, table 3 as cmps with just the normalised
data and then have "table12" and "table23" which hold the relation between
the two tables (either "1 and 2" in table12 or "2 and 3" in table23)


for example (using the standard tables for ease of explanation)
_______________________________________________________________________
table1  |table12        |table2 |table23                |table3
_______________________________________________________________________
department      |emp-dept       |employee       |emp-favTEAMS   |favNFLTEAMS
_______________________________________________________________________

I know the 3rd table (favourite NFL TEAMS) kinda weird but I had nothing
else in mind which would serve as a good example
(;-))

So store the PKs of table1 and table2 in table12 which is a two column
table.
The same applies to table2 and table3 utilising table23

This way u can have 3 CMP beans mapping to tables 1,2 and 3
** U NEED TO CREATE 2 NEW tables *** 12 and 23 though which would be
utilised by 2 new CMPs. The primary keys of these 2 tables would be the
combination of the columns.

U can use these CMPs in your session bean which might get a bit more complex
but atleast you wont have problems with portability since every  persistent
bean is Container managed and you dont have to hardcode sql anywhere.

I am not sure about the performance though but I would leave that to the
gurus like Richard/Rickard/Ian..........

Any comments???
Regards
Madhu




-----Original Message-----
From: Sanjay Nambiar [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 17, 1999 6:34 AM
To: [EMAIL PROTECTED]
Subject: A question about one to many relationships among tables


Hi,
Our application typically has the following scenario:

1>For Every Record of Table1 we have multiple records in Table2,in turn
whose every record has multiple records in Table3.
As the data volumes are very high,I wanted to know if the approach given
below is right
In the entity bean of Table 1 we have an extra attribute of say "Vector
type" which would contain the bean references of all the entitybeans
corresponding to Table 2.The same is done for the relationship between table
2 and table 3
In the entityBean for Table 1 we query the Table 2 and populate the
entitybean instances of Table 2 from Table 1 entitybean itself and store the
bean references in the Vector and then this Table 1 entitybean is accessed
from the sessionbean for all the records.

EJBServer supports bean managed persistence and the database is Informix

Any comments ....or an alternative better approach
SANJAY Nambiar

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