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

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

  • Follow-Ups:
    • Re: Inserting records into to-many relationship
      • From: Zak Burke <email@hidden>
  • Prev by Date: Re: How usable is WO in Xcode Tools 2.2 DP 1?
  • Next by Date: Re: How usable is WO in Xcode Tools 2.2 DP 1?
  • Previous by thread: Re: How usable is WO in Xcode Tools 2.2 DP 1?
  • Next by thread: Re: Inserting records into to-many relationship
  • Index(es):
    • Date
    • Thread