On Feb 25, 2006, at 9:10 PM, Jim Wong wrote:
EOModeler can build a valid many-to-many relationship between Company and Opportunity. This is preferable to building these relationships manually because it's easy to make a mistake. Click the Tools > Table Mode EOModeler menu. Select the model name (the top node along the left edge of the EOModeler window). In the right section of the window, select the Company and Opportunity entities. Click the Property > Join in Many to Many menu item. This will create Company.opportunities and Opportunity.companies to-many relationships that are flattened across the Opportunity_Company join entity. Inspect the Opportunity_Company entity to make sure that it has the correct table name. You may rename the Opportunity_Company entity to Opportunity_Customer and the Opportunity.companies relationship to Opportunity.customers if you prefer. Then when the form is submitted, iterate through the selected companies adding each company to the Opportunity.customers relationship: opportunity.addObjectToBothSidesOfRelationshipWithKey(selectedCompany, "customers"); Then send a saveChanges() message to the editing context. Your eomodel will guide EOF to automatically manage the Opportunity_Customer entity which you don't need to refer to in your code or even to generate a custom Java class for; just leave it an EOGenericRecord. Aloha, Art |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]
