• 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: Inserting records into to-many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inserting records into to-many relationship


  • Subject: Re: Inserting records into to-many relationship
  • From: Arturo PĂ©rez <email@hidden>
  • Date: Sun, 14 Aug 2005 16:18:18 -0400


-arturo

On Aug 14, 2005, at 3:57 PM, Florijan Stamenkovic wrote:


On Aug 14, 2005, at 15:30, Zak Burke wrote:

It gives me an exception that the
authorId of Books cannot bew null.

Make sure you set the author -->> books relationship to propagate its primary key.


Nope, that is NOT the case. I think that the only usage of propagate primary key is in one - to - one relationships (it is the only one I know about). On a one2many and reverse relationships it should NOT be checked.




The main reason to check Propagate Primary Keys is to support Join Tables where the join table's primary key is the set of primary keys of the joined items. An example for clarity. I have Author and Book and BookSale. BookSale records whenever one of the Author's Books sell. It records the Author, the Book and the sale price. In this case, the Author's primary key and the Book's primary key need to be propagated to the BookSale table in order to properly account for foreign key relationships. BookSale is a join table, in case that wasn't obvious, because it joins Author to Book. Poor relational example because BookSale isn't normalized properly but it gets the idea across.


_______________________________________________
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


  • Follow-Ups:
    • Re: Inserting records into to-many relationship
      • From: Florijan Stamenkovic <email@hidden>
References: 
 >Inserting records into to-many relationship (From: Tanmoy Roy <email@hidden>)
 >Re: Inserting records into to-many relationship (From: Zak Burke <email@hidden>)
 >Re: Inserting records into to-many relationship (From: Florijan Stamenkovic <email@hidden>)

  • Prev by Date: Re: Inserting records into to-many relationship
  • Next by Date: Re: Inserting records into to-many relationship
  • Previous by thread: Re: Inserting records into to-many relationship
  • Next by thread: Re: Inserting records into to-many relationship
  • Index(es):
    • Date
    • Thread