• 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: Multiple Row update
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Multiple Row update (From: "Oliver Leu" <email@hidden>)

  • Prev by Date: Re: Multiple Row update
  • Next by Date: Re: Newbie vs Many-To-Many (0 win-1 win)
  • Previous by thread: Re: Multiple Row update
  • Next by thread: Many problems for Many To Many Relationships across Databases
  • Index(es):
    • Date
    • Thread