Re: Saving entities problem [SOLVED]
Re: Saving entities problem [SOLVED]
- Subject: Re: Saving entities problem [SOLVED]
- From: Art Isbell <email@hidden>
- Date: Tue, 29 Jul 2003 11:39:10 -1000
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.