-
1. Re: Container Managed Relationships query
invisiblemage Aug 4, 2004 4:39 AM (in response to rajs1)how do you think the java code to access this field would look like?
-
2. Re: Container Managed Relationships query
rajs1 Aug 5, 2004 10:18 AM (in response to rajs1)Well, short answer is "I don't know".
Long answer is, at the moment I map Person-to-Organisation with a many-to-many (bidirectional) relationship.
I have a BMP Entity called PersonOrgRole that manages the Person_Organisation_List table.
I have JUnit tested the interactions between these three (entities) so far (to death) and it all seems to hang together.
The posting was to see if there were any other (better?) design ideas.
The design is done in UML and the exported XMI is passed through AndroMDA using the EJB cartridge.
This allows me to try various design options.
Cheers
-raj -
3. Re: Container Managed Relationships query
sbrbot Aug 19, 2004 3:36 AM (in response to rajs1)When using CMP beans for Person and Org EJBs, where you create many-to-many CMRs, you're NOT able to use columns from cross-table Person_Org_List. Unfortunatelly, EJB specification (framework) haven't yet evolved til this stage to be able to use this attributes. For now, cross table is used by many-to-many CMRs. So only PersID and OrgID are used under the hood by the container.
If you want to be able to use columns from cross-table then you have forget of many-to-many CMR and introduce additional EJB for cross-table where you will create one-to-many CMR between PersonEJB and PersonOrgEJB and another many-to-one CMR between PersonOrgEJB and OrgEJB. Only in this case you're able to reach attributes from cross table from PersonOrgEJB. I know that this complicates the application a bit but that's how it is.