• 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 relationship... some problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Many to many relationship... some problem


  • Subject: Re: Many to many relationship... some problem
  • From: "Ricardo J. Parada" <email@hidden>
  • Date: Mon, 10 Aug 2009 17:51:31 -0400


On Aug 10, 2009, at 6:25 AM, Francesco Romano wrote:

Ok.. I'm choosing the second method: I'll create setter and getter...
But.. two things: what is the difference between the addToOrderRelationship method and addObjectToBothSideOfRelationship ?

The addToOrderRelationship is probably generated by EOGenerator if you are using the wonder templates for your EOs.

Think of it as a convenience method to EOF's addObjectToBothSidesOfRelationship().


Second:
These are my methods:

public Ordine ordine() { 
  return super.ordine().get(0);
}

public void setOrdine(Ordine ord) {
NSArray<Ordine> ordini = super.ordine();
     if (ordini.count()>0)
      this.removeFromOrdineRelationship(ordini.get(0));
     this.addToOrdineRelationship(ord);
     
  }
}

But.. in the getter I've an error: I'm overriding a "super" method that returns an array... can I change the name to getOrdine or there are some problems??


Are you using the same name for both the to-one and the to-many methods?  I think they should be different.  In other words your generated _Cart class would have an orders(), addToOrders(), addToOrdersRelationship(), etc.

Then you would add the order() and setOrder() method in Cart.java (the subclass of _Cart) that are simply cover methods to the to-many orders.

At least that's how I understood it.

:-)




 _______________________________________________
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 relationship... some problem (From: Francesco Romano <email@hidden>)
 >Re: Many to many relationship... some problem (From: Lachlan Deck <email@hidden>)
 >Re: Many to many relationship... some problem (From: Francesco Romano <email@hidden>)
 >Re: Many to many relationship... some problem (From: Lachlan Deck <email@hidden>)
 >Re: Many to many relationship... some problem (From: Francesco Romano <email@hidden>)
 >Re: Many to many relationship... some problem (From: Amedeo Mantica <email@hidden>)
 >Re: Many to many relationship... some problem (From: Amedeo Mantica <email@hidden>)
 >Re: Many to many relationship... some problem (From: Francesco Romano <email@hidden>)
 >Re: Many to many relationship... some problem (From: Amedeo Mantica <email@hidden>)
 >Re: Many to many relationship... some problem (From: Francesco Romano <email@hidden>)
 >Re: Many to many relationship... some problem (From: Amedeo Mantica <email@hidden>)
 >Re: Many to many relationship... some problem (From: Francesco Romano <email@hidden>)
 >Re: Many to many relationship... some problem (From: Ray Kiddy <email@hidden>)
 >Re: Many to many relationship... some problem (From: Francesco Romano <email@hidden>)

  • Prev by Date: Re: Many to many relationship... some problem
  • Next by Date: Re: Flex w/WO (was: AJAX w/WO)
  • Previous by thread: Re: Many to many relationship... some problem
  • Next by thread: Re: Many to many relationship... some problem
  • Index(es):
    • Date
    • Thread