Re: databases and bool values
Re: databases and bool values
- Subject: Re: databases and bool values
- From: Ian Joyner <email@hidden>
- Date: Mon, 31 Jul 2006 11:56:47 +1000
Char (1) should be more space efficient than integer in the DB (so
long as db implementation only uses one character and doesn't pad it
out).
I'm not too keen on the loose type definitions (a la C) of 0 = false,
any other value = true. I have not tried the integer solution in Java
client check boxes, but I would hope it would not work!
Ian
On 29/07/2006, at 3:31 AM, Amedeo Mantica wrote:
Hello
I use integer data for boolean
0=false
1=true
no need any code, just works fine, also on WOCheckBox.
Amedeo
On 28/lug/06, at 01:42, Ian Joyner wrote:
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:
40macintossicati.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:
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