Re: design help
Re: design help
- Subject: Re: design help
- From: Michael Engelhart <email@hidden>
- Date: Mon, 30 Aug 2004 10:06:02 -0500
Thanks Arturo -
I guess my confusion stems from the fact that I need to mandate that
there be ONLY two frequent traveler numbers for a particular car
reservation. I was thinking maybe there was some sort of constraint I
could put on the column with EOModeler. but I guess the best way would
just be to have that in my EO code then?
Thanks
MIke
On Aug 30, 2004, at 10:00 AM, Arturo Perez wrote:
Michael Engelhart wrote:
I have a travel FrequentTraveler table that stores frequent traveler
numbers (airline frequent flyer numbers, car rental agency requent
renter numbers, hotel frequent guest numbers, etc).
I have a CarReservation table that stores data associated with a car
reservation. Two of the allowable pieces of information are a
single airline frequent flyer number and a single car rental agency
frequent renter number. ... My
original design idea would be to keep all a customers frequent
traveler numbers (some customers can have as many as 20 or 30 if they
are business travelers) in the FrequentTraveler table in a
one-to-many relationship. I'm not sure how to model this
relationship back to FrequentTraveler so that I just store
FrequentTravelId's in my CarReservation table.
Hi Mike,
Not sure I follow the problem.
You have FrequentTraveler->>FreqTravNo
CarReservation->>FreqTravNo (it's a toMany because you allow two) or
CarReservation->FreqTravNo (if you keep airline and people numbers
separate).
To get to a FrequentTraveler from a CarReservation.
carReservation.valueForKeyPath("freqTravNo.frequentTraveler");
To set a FrequentTravelerNumber on a reservation
carReservation.addObjectToBothSidesOfRelationshipWithKey(
selectedFreqTravNo, "freqTravNo");
Is all that right?
-arturo
_______________________________________________
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.