Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?)
Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?)
- Subject: Re: Entity Modeller - Setting Up Many-to-Many Relationships: Link Entities(?)
- From: Lachlan Deck <email@hidden>
- Date: Fri, 6 Feb 2009 23:14:13 +1100
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.
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