Re: help needed because of 5.3
Re: help needed because of 5.3
- Subject: Re: help needed because of 5.3
- From: "Gennady Kushnir" <email@hidden>
- Date: Fri, 5 Aug 2005 01:07:31 +0400 (MSD)
- Importance: Normal
If to talk about books i'd recommend Apple's pdf "Java for WO developers"
it gives basic Java and also useful WO specific Classes (Like NSArray and
NSDictionary).
Brian, main problem of your code is that EOs do not store primitive data
types like int or double When you store numeric values in EO you use
wrapper classes like Integer and Double or more generic Number.
It may also be good idea to red API at least for EOEnterpriseObject and
say Number.
regards
Gennady
> Hi Brian,
>
> Something like this.....
>
> public Number resultID() {
> return (Number)storedValueForKey("resultID");
> }
> public void setResultID(Number value) {
> takeStoredValueForKey(value, "resultID");
> }
>
> usage:
> int result = myEO.resultID().intValue();
>
> result++;
>
> result = 2 + result;
>
> myEO.setResultID( new Integer( result ) );
>
>
> I recommend this book for learning and reference. It's very easy to use.
http://homepage.mac.com/kelleherk/iblog/C981504028/E1931110183/
> index.html
>
> Regards,
>
>
> -Kieran
> ________________________________________________________________ Blog:
http://webobjects.webhop.org/
>
>
> On Aug 4, 2005, at 10:45 AM, Anjo Krank wrote:
>
> > Actually that code has one error in every line (except for the ones
with only a brace)... you really need to read a Java book first...
> >
> > Cheers, Anjo
> >
> > Am 04.08.2005 um 15:28 schrieb brian day:
> >
> >> Hi,
> >>
> >> Im sure all of you know about WO 5.3's inability to generate the
> java
> >> files from EOModeler due to missing templets if your not
> upgrading
> >> from 5.2, if you don't trust me. I have been able to generate my
> own
> >> so far but now i need an int. I need to put a int into the
> column
> >> resultID and i need to be able to return it. Here is my code:
> >> public String resultID() {
> >> return (int)storedValueForKey("resultID");
> >> }
> >> public void setresultID(int value) {
> >> takeStoredValueForKey(value, "resultID");
> >> }
> >> it is the standard send and return String, but changed to int
> >>
> >> I get the error
> takeValueForKey(java.lang.Object,java.lang.String) in
> >> com.webobjects.eocontrol.EOCustomObject cannot be applied to
> >> (int.java.lang.String)
> >>
> >> Would anyone send me the lines of code to add to my .java file?
> >>
> >> thanks
> >> brian
> >>
> >>
> >> _______________________________________________
> >> WebObjects-dev mailing list
> >> email@hidden
> >> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
> >>
> >
> > _______________________________________________
> > WebObjects-dev mailing list
> > email@hidden
> > http://www.omnigroup.com/mailman/listinfo/webobjects-dev
> >
>
> _______________________________________________
> 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
>
_______________________________________________
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