• 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: Saving entities problem [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving entities problem [SOLVED]


  • Subject: Re: Saving entities problem [SOLVED]
  • From: Jevon Hills <email@hidden>
  • Date: Thu, 31 Jul 2003 15:25:50 -0600

OK now I feel foolish - I wasn't getting an exception, because I was catching it and not display in the message....DOUGH!!!

The error I'm getting when I try to save my User obj after giving it a permission and an application is:

Attempt to insert null key into a com.webobjects.foundation.NSMutableDictionary.

I'm assuming that this is the SyBasePlugin class throwing this, but I don't know.

any thoughts on this.

Jevon



On Tuesday, July 29, 2003, at 03:39  PM, Art Isbell wrote:

On Tuesday, July 29, 2003, at 11:11  AM, Jevon Hills wrote:

The UserApplicationPermission table has the 3 columns you'd expect plus a column called uapID with is the PK of the table.

This may be the problem. The 3 attributes should all be part of the primary key. There's no need for uapID if you want this entity to be a typical join entity. The values for the 3 primary key attributes will be propagated from the 3 entities that are joined assuming that the to-many relationships from the 3 entities to UserApplicationPermission are configured to propagate the primary key which is what EOModeler does when it joins two entities in a many-to-many relationship.


POSSIBILITIES: As I'm takin' shots at this the key that I'm using for the addObjectToBothSidesOfRelationshipWithKey() method is the name of the flattened relationship in the User entity.
(i.e. aUser.addObjectToBothSidesOfRelationshipWithKey(anApp, "fltn_application");) Is This Correct??

That should be correct.

As far as the Join table goes. Does having a 'rowid' PK on the table have an impact on this situation?

See above.

I am using 'this.session().defaultEditingContext().saveChanges();' to save my changes, is this correct? Or do I retrieve the User obj's EditingContext and use that? If the latter how to I get the User obj's EditingContext?

You can ask any object for its editing context by sending it an editingContext() message. Are you using multiple editing contexts? If so, you'll need to make local instances of all objects in the editing context being saved. If you don't, an exception will be thrown, so that's apparently not happening to you.


Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



Jevon K. Hills
Developer - Zymeta Media Promotion Systems
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Saving entities problem [SOLVED] (From: Art Isbell <email@hidden>)

  • Prev by Date: Re: "Cannot obtain globalId for an object which..."
  • Next by Date: Re: Saving entities problem [SOLVED]
  • Previous by thread: Re: Saving entities problem [SOLVED]
  • Next by thread: Re: Saving entities problem [SOLVED]
  • Index(es):
    • Date
    • Thread