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