• 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: Problem with Saving Data Changes to Oracle Table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with Saving Data Changes to Oracle Table


  • Subject: Re: Problem with Saving Data Changes to Oracle Table
  • From: Nathan Dumar <email@hidden>
  • Date: Sun, 18 Jul 2004 19:10:19 -0400

My guess is that the object "url" is not registered with the editing context "ec." Did you fetch the object into ec?

Also, you can simplify some of the code by doing something like ...

Public WOComponent countHitsOnUrl(){
WOComponent urlListing = pageWithName("WORedirect");
url.setUrlHits( (Integer)url.urlHits() + 1); // gets & sets in one statement
ec.saveChanges();
urlListing.takeValueForKey(url.ValueForKey("url"),"url");
return urlListing;
}


Nathan

On Jul 18, 2004, at 3:49 PM, email@hidden wrote:

Public WOComponent countHitsOnUrl(){
    WOComponent urlListing = pageWithName("WORedirect");
    Number hitCount = url.urlHits();
    Int hitCount2 = hitCount.intValue() + 1;
    Number hitCount3 = (Number) hitCount2;
    url.setUrlHits(HitCount3);
    ec.saveChanges();
    urlListing.takeValueForKey(url.ValueForKey("url"),"url");
    return urlListing;
}


The code below is in the class file for the Oracle table:

Public void setUrlHits(Number value) {
    takeStoredValueForKey(value, "urlHits");}

public number urlHits() {
    return (Number) storedValueForKey("urlHits");}
_______________________________________________
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: 
 >Problem with Saving Data Changes to Oracle Table (From: email@hidden)

  • Prev by Date: WebMail via WebObjects
  • Next by Date: Another strange WOFileUpload behaviour...(part 2)
  • Previous by thread: Problem with Saving Data Changes to Oracle Table
  • Next by thread: WebMail via WebObjects
  • Index(es):
    • Date
    • Thread