Re: databases and bool values
Re: databases and bool values
- Subject: Re: databases and bool values
- From: Ian Joyner <email@hidden>
- Date: Fri, 28 Jul 2006 09:42:34 +1000
I just store booleans in a one character field (which you should
define as a protoype in EOModeler in the EOPrototypes entity as Value
Class NSString, Value Class (Java) String, external type char, width
1, in case this definition ever needs to change).
Then the code looks like:
static String true_string = "T";
static String false_string = "F";
and if linked to a button, provide these routines in your class that
extends the class generated by EOGenerator:
public boolean is_a_manager_button () {
return is_a_manager ().equals (true_string);
}
public void setIs_a_manager_button (boolean value) {
setIs_a_manager (value? true_string: false_string);
}
Ian
On 28/07/2006, at 2:42 AM, Theodore Petrosky wrote:
I am relatively new to WO and I don't understand how
to handle boolean values. I am just starting to play
with a database (postgresql) that I normally access
from a cocoa app that I wrote.
When I use EOModeller to reverse engineer the
table(s), the booleans come across as NSNumber class.
however postgresql stores the value as 't' or 'f'.
I don't understand how to handle these booleans? What
am I missing in my understanding of how to talk to the
database?
Is there any documentation available (or examples)?
Thanks,
Ted
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40sportstec.com
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