• 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: Multiple One-to-One Core Data relationships & inverse
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple One-to-One Core Data relationships & inverse


  • Subject: Re: Multiple One-to-One Core Data relationships & inverse
  • From: Frédéric Testuz <email@hidden>
  • Date: Fri, 7 Sep 2007 15:27:39 +0200

Le 7 sept. 07 à 14:36, Frank Reiff a écrit :

Hi,

This is probably a stupid newbie question again, but I can't get my head around this..

The Core Data documentation makes a big deal about the fact that each relationship should have an inverse & the compiler now even throws a warning when there isn't an inverse.

What I don't get is this how this is supposed to work with multiple role based one-to-one relationships ("has a").

Say you have a money transfer entity that takes a debit and a credit account.

You'll have:

MoneyTransfer:
creditedAccount one-to-one relationship to Account
debitedAccount one-to-one relationship to Account

Now Account should have an inverse relationship for this!?

The inverse could either go to creditedAccount or debited account, but not both..!?

What am I missing?
You are missing that you have not one, but two inverse relationship. One for debit and one for credit.

And the relationship is not one to one relationship, but one to many. Each account will have many credit and debit transfers. You can have something like :

MoneyTransfer:         Account :
creditedAccount <<---> creditTransfers
debitedAccount  <<---> debitTransfers

Best regards,

Fred_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Multiple One-to-One Core Data relationships & inverse
      • From: Frank Reiff <email@hidden>
References: 
 >Multiple One-to-One Core Data relationships & inverse (From: Frank Reiff <email@hidden>)

  • Prev by Date: Re: RS: NSObject members class and isMemberOfClass
  • Next by Date: Re: Waiting for a USB device to connect
  • Previous by thread: Multiple One-to-One Core Data relationships & inverse
  • Next by thread: Re: Multiple One-to-One Core Data relationships & inverse
  • Index(es):
    • Date
    • Thread