Re: Inserting records into to-many relationship
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