Re: Many-to-Many Question
Re: Many-to-Many Question
- Subject: Re: Many-to-Many Question
- From: David LeBer <email@hidden>
- Date: Fri, 26 Mar 2004 18:47:36 -0500
On 26-Mar-04, at 6:16 PM, James Cicenia wrote:
Hello -
I have followed the instructions in creating a many-to-many
relationship:
Portfolio <---->> Metrics <---->> MetricListNames <---->> LinkingTable
<<----> Project
What I want to do is on the Project page have a list of "Metrics" in a
repetition in column A
with a popup of the "MetricListNames" in column B. How do I use the
popup to link/create
the "LinkingTable" record/object??
Do I have to manually instantiate the LinkingTable Object and set the
relationships? Or
is there an automagic way that WebObjects can do this?
*IF* the LinkingTable is a database artifact *ONLY*, ie: if it serves
no purpose other than to link MetricListNames and Project (stores no
data other than the PK's of those two tables), then you can flatten the
relationship from MetricListNames to Project in EOModeler so:
MetricListNames<---->>LinkingTable<<---->Project
Becomes:
MetricListNames<<----->>Project
If you name the relationship from Project "metricListNames" then you
can do this:
project.addObjectToBothSidesOfRelationshipWithKey(metricListNameItem,
"metricListNames");
And EOF will automagically create the join table entity for you.
Make sure that you set the relationship from MetricListNames and
Project to the join table to cascade delete, and propagate primary
keys.
;david
--
David LeBer
Codebase Software Systems
site: http://www.codebase.ca
blog: http://david.codebase.ca
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.