• 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
Updating data in the DB, was: opposite to objectMatchingKeyAndValue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Updating data in the DB, was: opposite to objectMatchingKeyAndValue


  • Subject: Updating data in the DB, was: opposite to objectMatchingKeyAndValue
  • From: Gustavo Pizano <email@hidden>
  • Date: Wed, 25 Feb 2009 21:18:58 +0100

Hello,

First of all, for those who remember my questing about something opposite to the method  objectMatchingKeyAndValue, well I decided to do the following:
1. since what the user is registering are products into the stock, if a product already exist, it will update the quantity in stock with the one that it's being register,.

2. inform the user if it was right, and give the option to confirm, in which case will continue the execution normally, or if its a mistake, it can undo (I read something about undo in the EOF programming guide)

So now, in case all was fine, I wanna update the quantity of the object, I got the Object with the following.
Product p = (Product)EOUtilities.objectMatchingKeyAndValue(session().defaultEditingContext(), "Product", Product.CODE_KEY, code);
so Product has a attribute, numberItemsinStock, how can I update that info with the new one?
should I take the old vale add the new one, and save the product in the EC, and then save changes? or...


what you think, suggestions.
?

Thanks


Gustavo
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: FireFox can't render a image, but Safari Does.
  • Next by Date: Re: Hibernate
  • Previous by thread: UUID Primary Key after insertion and before saveChanges
  • Next by thread: Need some advice (iframe)
  • Index(es):
    • Date
    • Thread