Re: Problem with Saving Data Changes to Oracle Table
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.