Re: Saving entities problem [SOLVED]
Re: Saving entities problem [SOLVED]
- Subject: Re: Saving entities problem [SOLVED]
- From: Jevon Hills <email@hidden>
- Date: Tue, 29 Jul 2003 15:11:48 -0600
I can't change the database that much. Our database security is
structured around several of these 3-Way joins, not just applications,
but UserConsolerPerms, UserCollectionPerm, UserPromoCollectionPerm,
SmartCardConsolePerm
So our Users table, Permission table and other are just lists.
myClass
{
pubUser aUser;
pubApplication anApp;
pubPermission aPerm;
EOEditingContext editingContext;
aUser.addObjectToBothSidesOfRelationshipWithKey(anApp,
"pubApplication");
aUser. addObjectToBothSidesOfRelationshipWithKey(aPerm,
"pubPermission")
editingContext.saveChanges()
}
Looks good to me, but does it work ?-)
Not yet. I'm not sure where the problem lies. I have some control
over every aspect of this area (ie table definitions, pk's, fk's) so I
can make changes at any level. I don't think I gave any info regarding
the database in the last mail.
Switching to Sybase: therefore I have a stored proc called
eoForPkTable, and a table named 'eo_sequence_table', and a java class
called 'SyBasePlugin'.
The UserApplicationPermission table has the 3 columns you'd expect plus
a column called uapID with is the PK of the table.
When I execute the code and save the ec there is no error message
returned to me, but no data is writen UserApplicationPermission.
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??
As far as the Join table goes. Does having a 'rowid' PK on the table
have an impact on this situation?
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?
Thank you so much for your assistance Art. The more I learn about WO
the more I won't use anything else.
Jevon
_______________________________________________
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.