Hi,

On Sat, 2006-02-18 at 12:53 +1100, Lachlan Deck wrote:
> Hi there,
> 
> further to the other's suggestions...
> 
> On 16/02/2006, at 2:40 AM, Randall Perry wrote:
> 
> > I used eomodeler to generate the model and EO classes from a  
> > Postgresql db.
> > I'm having a problem using the boolean data type. If I reference a  
> > boolean
> > field 'rec.campsiteFri()' like so:
> >
> > if (rec.campsiteFri()) {
> >             return true;
> >         }
> >
> > I get a compiler error 'incompatible types'.
> 
> Of course you do. For these kinds of Java-based errors you need to  
> ask yourself:
> The return type of campsiteFri() is:
>       a) a 'boolean'
>       b) a 'Boolean'
>       c) a 'Number'
>       d) a primitive other than 'boolean'
>       e) some other Object
> 
> You answer will have to be anything other than 'a' because in Java  
> (as opposed to C) 'if' statements must take a 'boolean' primitive  
> only (or an expression that returns a boolean primitive). Not an int  
> or even an Object of type Boolean.
> 

I just thought I'd point out that if your using Java 5.0 that you can do
the following:

Boolean b = new Boolean(true);

if (b){
 // its true
}else{
 // its false
}

Yay autoboxing!

regards
 -shaun



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to