Inserting records into to-many relationship
Inserting records into to-many relationship
- Subject: Inserting records into to-many relationship
- From: Tanmoy Roy <email@hidden>
- Date: Sun, 14 Aug 2005 11:49:30 +0530
Hi All,
I know this has been discussed in detail before but I am facing this weird issue of inserting into 2 tables having a to-many relationship.
Let's say I have a table Author and Books. Primary key of the author table is a one up sequernce number from an sequence Author_seq. This unique number is bound to the author_id column in the Books table. The pkey of the books is also an one up sequence num. from books_seq. Now I am setting the author details to the Author object then
editingContext.insertObject(author) and the coresponding book details to Books object in a loop (steps : set book details, author.addObjectToBothSidesOfReln.(book), editingContext().insertObject(book)) then doing a editingContext.saveChanges
(). It gives me an exception that the authorId of Books cannot bew null. But AFAIK this would have been done by the method addObjectTo...
I am totally stumped. Please help..
--
Best,
Tanmoy
_______________________________________________
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