• 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: Many-to-many question ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Many-to-many question ...


  • Subject: Re: Many-to-many question ...
  • From: "Daniele Corti" <email@hidden>
  • Date: Fri, 26 Oct 2007 09:17:24 +0200



2007/10/26, Lachlan Deck <email@hidden>:
On 25/10/2007, at 7:37 PM, Daniele Corti wrote:

> > 2007/10/25, Lachlan Deck <email@hidden>:
> >> You have two choices with M2M Join tables.
> >> A<-->>AB<<-->B
> >>
> >> 1) flatten the relationships... so that you're adding to both sides
> >> of relationship two records on either side of the join. Join
> records
> >> using EOGenericRecord and don't have any logic in them.
> >>
> >> A myA = (A)EOUtilties.createAndInsertInstance(ec, "A");
> >> B myB = (B)EOUtilties.createAndInsertInstance(ec, "B");
> >> myA.addObjectToBothSidesOfRelationshipWithKey(myB, "bs");
> >
> > How this work? Do you need to set the EOmodel in some way?
>
> Flattening relationships involves creating a many-to-many join like
> here:
> http://wiki.objectstyle.org/confluence/display/WOL/Creating+a+Many+to
> +Many+Join
>
> Thank you, but is there a way in EOModeler? (really, I've never
> completely understand how to user Entity Modeler)

Sure.
1) Select two entities (make sure you've given them a primary key
each, an entity name, external name)
2) Choose Property > Join in Many to Many
3) make sure join entity has its external name and entityName as
desired.

That's Perfect, thank you!

The concept in Entity Modeler is similar - but far less buggy....
i.e., select two entities, right-click, choose New Relationship...
and follow the prompts. I really suggest that you jump over to using
WOLips now. Really, the water is fine, there's lots of help available.
> > 2) don't flatten the relationships
>
> Otherwise, create normal toMany relationship from A to AB, and B to
> AB in the modeler.
>
> Usually I use this , but I like to continue learning new way to do
> things ;-P

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: email@hidden



--
Daniele Corti
AIM: S0CR4TE5
Messenger: email@hidden

--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS

--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young
 _______________________________________________
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: 
 >Many-to-many question ... (From: "Shagor Ghani" <email@hidden>)
 >Re: Many-to-many question ... (From: Lachlan Deck <email@hidden>)
 >Re: Many-to-many question ... (From: "Daniele Corti" <email@hidden>)
 >Re: Many-to-many question ... (From: Lachlan Deck <email@hidden>)
 >Re: Many-to-many question ... (From: "Daniele Corti" <email@hidden>)
 >Re: Many-to-many question ... (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: EOUtilities.objectMatchingValues bug?
  • Next by Date: Re: EOUtilities.objectMatchingValues bug?
  • Previous by thread: Re: Many-to-many question ...
  • Next by thread: How can I name checkboxes in a table for a javascript?
  • Index(es):
    • Date
    • Thread