• 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: Why no 1to1 relationships?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why no 1to1 relationships?


  • Subject: Re: Why no 1to1 relationships?
  • From: Art Isbell <email@hidden>
  • Date: Wed, 2 Apr 2008 10:56:13 -1000

On Apr 2, 2008, at 9:52 AM, Sacha Michel Mallais wrote:

It is definitely possible to have an optional to-one, just not one where the FK is also the PK.


But if the FK isn't the PK, then the FK isn't guaranteed to be unique. But it must be unique because it joins with the PK of another object which, by definition, is unique. I suppose that you could add a unique constraint to the FK, but that's cheating :-) (at least, to relational DB purists)

So an optional to-one relationship is really a to-many relationship constrained to contain no more than 1 object (i.e., 0 or 1 object). From the "EOModeler User Guide":

"Cardinality
Every relationship has a cardinality. The cardinality defines how many destination records can potentially resolve the relationship. In relational database systems, there are generally two cardinalities:


• to-one relationship — for each source record, there is exactly one corresponding destination record
• to-many relationship — for each source record, there may be zero, one, or more corresponding destination records"


Aloha,
Art

_______________________________________________
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: 
 >Why no 1to1 relationships? (From: Jeff Schmitz <email@hidden>)
 >Re: Why no 1to1 relationships? (From: Jacky Gagnon <email@hidden>)
 >Re: Why no 1to1 relationships? (From: Robert Walker <email@hidden>)
 >Re: Why no 1to1 relationships? (From: Art Isbell <email@hidden>)
 >Re: Why no 1to1 relationships? (From: Sacha Michel Mallais <email@hidden>)

  • Prev by Date: Re: Locking Session.defaultEditingContext() Question
  • Next by Date: Re: an interesting lockRowComparingAttributes:
  • Previous by thread: Re: Why no 1to1 relationships?
  • Next by thread: Re: Why no 1to1 relationships?
  • Index(es):
    • Date
    • Thread