Re: EOQualifier and boolean
Re: EOQualifier and boolean
- Subject: Re: EOQualifier and boolean
- From: Ian Joyner <email@hidden>
- Date: Mon, 4 Sep 2006 10:36:29 +1000
On 02/09/2006, at 3:04 PM, Joe Little wrote:
I saw this recently on the list, but for whatever reason my string
based qualifier isn't having an effect.
I have some values that are integer in the DB (1 or 0) -- and others
are boolean and appears as t or f in SQL results. Well, in my
qualifier format string, I have things like "and checkedValue = 1" and
that works. But "and checkedbooleanvalue = true" doesn't effectively
work, but no errors come of it.
Is there an obvious string based syntax that should work?
Have you simplified things for your post? 'checkedbooleanvalue =
true' I think should be flagged as at least a warning by the
compiler, since C-based languages have confused the equality operator
with assignment. What I think you mean is 'checkedbooleanvalue ==
true', however the == true bit is superfluous. Rather than if
(checkedbooleanvalue == true) just if (checkedbooleanvalue) is better
stylistically.
If that's not the problem, what you describe should work. I use:
I use:
static String true_string = "T";
static String false_string = "F";
public boolean is_a_doctor_button () {
return is_a_doctor ().equals (true_string);
}
public void setIs_a_doctor_button (boolean value) {
setIs_a_manager (value? true_string: false_string);
}
Ian
_______________________________________________
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