• 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: ec.saveChages gives null exception (didn't before)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ec.saveChages gives null exception (didn't before)


  • Subject: Re: ec.saveChages gives null exception (didn't before)
  • From: Arturo Perez <email@hidden>
  • Date: Tue, 08 Mar 2005 10:42:21 -0500

Hi Drew,

Typically the below is done like:

Book = EOUtilities.createAndInsertInstance(ec,"Book");
Student = EOUtilities.createAndInsertInstance(ec,"Student");
student.addObjectToBothSidesOfRelationshipWithKey(book, "theBorrowedBooks");

This takes care of all the primary/foreign key issues.
Colin Clark wrote:

Drew,

As far as I can understand, you don't need to expose the primary key for this kind of a relationship. I think the problem is that you're thinking in terms of database design, not in terms of your object model.


On 8-Mar-05, at 6:48 AM, Drew Thoeni wrote:


I do have the primary key exposed, but believe I needed to because I'm doing "manual" joins to an unflattened table that is a many-to-many. Here's the snippet of code that does that. Without access to the key, classNumber(), I don't know how to make that join happen. Any thoughts? Am I looking at this all wrong?


BookStudent newBSJoin = (BookStudent)EOUtilities.createAndInsertInstance(ec,"BookStudent");
newBSJoin.setClassNumber(this.classNumber());


I think this may be the problem, as it is the only non-null column.


_______________________________________________ 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: 
 >ec.saveChages gives null exception (didn't before) (From: Drew Thoeni <email@hidden>)
 >Re: ec.saveChages gives null exception (didn't before) (From: Chuck Hill <email@hidden>)
 >Re: ec.saveChages gives null exception (didn't before) (From: Drew Thoeni <email@hidden>)
 >Re: ec.saveChages gives null exception (didn't before) (From: Chuck Hill <email@hidden>)
 >Re: ec.saveChages gives null exception (didn't before) (From: Drew Thoeni <email@hidden>)
 >Re: ec.saveChages gives null exception (didn't before) (From: Colin Clark <email@hidden>)

  • Prev by Date: Re: ec.saveChages gives null exception (didn't before)
  • Next by Date: Re: D2W EditToOne relationship question
  • Previous by thread: Re: ec.saveChages gives null exception (didn't before)
  • Next by thread: Re: ec.saveChages gives null exception (didn't before)
  • Index(es):
    • Date
    • Thread