• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: Paul D Yu <email@hidden>
  • Date: Sun, 26 Feb 2006 14:29:19 -0500

Jim

You are trying to create a many-to-many relationship between Company and Opportunity.

In EOModeler, under the graphic diagram view, select both entities.  Then select the Property menu choice, and select the Join in Many-to-Many sub choice.  This will create the Opportunity_Company table for you, but it will not have any external table name nor attribute in it.  You will need to add them.  However, the more important thing is that EOModeler would have created for you six relationships in the three Entities.

In the Opportunity_Company table there will be company and opportunity to-one relationships to the parent entities respectively.

In the Company table (entity) there will be <b>opportunitys</b> and opportunityCompanys relationship.  The <b>opportunitys</b> relationship is the FLATTENED relationship.  It is based on the opportunityCompanys.  It is shown in Bold Black and an class attribute.  The opportunityCompanys relationship is the "real" relationship, but not a class attribute.

The same is true in the Opportunity table (entity).

The flattened relationship allows you to say aCompany.opportunites() to get the list of opportunities back, instead of going to the opportunityCompanys table then asking for the opportunities() from there.

And the company.addObjectToBothSidesOfRelationshipWithKey( newOpportunity, "opportunitys" ) would automatically create the association record in the Opportunity_Company table.

This only works if you don't have any additional attributes to capture in the Opportunity_Company table, e.g. start_date, end_date, etc.

If you have these additional attributes then it is another story....

Paul

thanks art. 

what's flattened relationships? i can't catch wat the WO tutorial is talking abt. when do i use flattened and when do i not use? any pros and cons?

Warmest Regards,
Jim Wong
email@hidden


 _______________________________________________
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

  • Prev by Date: Re: Sophisticated relationship help
  • Next by Date: URI for static html/image
  • Previous by thread: (no subject)
  • Next by thread: EOModeler and OpenLDAP
  • Index(es):
    • Date
    • Thread