Many-to-Many without Flattened Relationship
Many-to-Many without Flattened Relationship
- Subject: Many-to-Many without Flattened Relationship
- From: Anthony Martello <email@hidden>
- Date: Sun, 26 Feb 2006 15:12:08 -0700
Guys,
I have a similar question to Jim's regarding many-to-many relationships
except that in my join table I have more information than simply the
two keys (the scenario mentioned by Mike); so I can't use a flattened
relationship.
Here is my situation.
I have a three tables: Account, CourseAccess and Course. Each customer
from Accounts can purchase access to one or more courses from Course
for a limited time. Account has PK userId and Course has PK courseId.
CourseAccess is a join table with attributes courseId, userId and
endDate. To keep track of which user is purchasing the course, I have
an instance of Account in the session named "account" and method
currentAccount() which returns "account" (not sure if I need this
last).
My questions are:
1) Is this the best way to set this up by keeping the endDate attribute
in the join table?
2) Once the relationship is set up in EOModeler: a) how do I add a
course to a client (I assume I will use
addObjectToBothSidesOfRelationshipWithKey) and b) how do I set the
endDate in the join table?
I appreciate any help.
Sincerely,
Anthony Martello
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden