Re: Multiple Row update
Re: Multiple Row update
- Subject: Re: Multiple Row update
- From: Art Isbell <email@hidden>
- Date: Sun, 2 Mar 2003 09:43:40 -1000
On Sunday, March 2, 2003, at 12:14 AM, Oliver Leu wrote:
The first table: Users, contents user1 and user2
Second table: themes, contents many themes, created by the users.
Problem: If someone tries to delete user1, I want to take all the
themes
bound to user1 and wanna give them
user2 (for example).
How can I realize that in an OO - Way?
The "User" entity should include a "themes" to-many relationship that
contains theme objects that are related to a particular user. To move
the themes belonging to user1 to user2, iterate through the
user1.themes() array sending user2 the message
addObjectToBothSidesOfRelationshipWithKey(currentTheme, "themes"). For
further information about this method, see the
EORelationshipManipulation javadoc.
If you were merely transferring themes from user1 to user2, you'd also
need to send user1 a
removeObjectFromBothSidesOfRelationshipWithKey(currentTheme, "themes")
message, but because user1 is being deleted, that's not necessary.
Art
http://homepage.mac.com/aisbell/
_______________________________________________
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.