• 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
Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?)


  • Subject: Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?)
  • From: Tim Kitchener <email@hidden>
  • Date: Tue, 10 Feb 2009 15:23:10 +0000

Thank you very much,

I have successfully implemented this with a flattened relationship and was pleasantly surprised as to how easy it is to do! :)

I do require, in another join, to store information in the join.  In this instance,  do I need to treat them as two separate relationships:  Whereas before I add and relate the objects using entityA.addObjectToBothSidesOfRelationshipWithKey(entityB, "entityBs"); and access them all using entityA.entityBs();, will I now need to access them via the join and manage both relationships manually? e.g. access: entityA.joinEntities.entityB();

Thanks and kindest regards,

-- Tim


On 6 Feb 2009, at 12:14, Lachlan Deck wrote:

Hi Tim,

On 06/02/2009, at 10:26 PM, Tim Kitchener wrote:

<...>would really appreciate it if you could take the time to produce me an idiots'-guide to set this up.

The scenario that I need to model for our current project requires many-to-many relationship between my entities.

The easiest way to achieve this is:
- open the model in WOLips entity modeler
- create Entity A and Entity B with their relative attributes and relationships (except for the relationship to each other)
- select the two entities
- ctl click and select Create Relationship.
- in the wizard that appears have both sides as a toMany. This will auto-create a join entity for you with the relevant relationships from and to each entity.
- generate sql

This will create flattened relationships between the two outer entities by default such that you don't think about the join entity - it's just a db artifact in the background. If, however, you need to store additional information in the join then you simply have a toMany from Entity A to the join, a toMany from Entity B to the join and toOne relationships from the join to A and B. Just untick flatten relationships.

<Picture 11.png><Picture 12.png>
with regards,
--

Lachlan Deck




 _______________________________________________
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

References: 
 >Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?) (From: Tim Kitchener <email@hidden>)
 >Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?) (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: EOF inside of an axis app running in Tomcat
  • Next by Date: WOLips Entity Modeler
  • Previous by thread: Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?)
  • Next by thread: Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?)
  • Index(es):
    • Date
    • Thread