Re: Saving entities problem [SOLVED]
Re: Saving entities problem [SOLVED]
- Subject: Re: Saving entities problem [SOLVED]
- From: Jevon Hills <email@hidden>
- Date: Thu, 31 Jul 2003 08:54:59 -0600
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.
The Join table exists in the DataBase, so EOModeler is not creating the
Join. In EOModeler if I look at the relationship between
Users<-->>UserApplicationPermission the Pk is not set to propagate on
either side of the relationship. I'm going to try setting this my self
for each 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.
I'm not instantiating any editingContext's, so I assumed that default
was fine.
Thanx for your time - I'll keep ya posted.
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.