• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: databases and bool values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >databases and bool values (From: Theodore Petrosky <email@hidden>)
 >Re: databases and bool values (From: Ian Joyner <email@hidden>)
 >Re: databases and bool values (From: Amedeo Mantica <email@hidden>)

  • Prev by Date: SOLVED Re: ERJavaMail Framework NoClassDefFoundError
  • Next by Date: Problem of latency during lauching of WebObject app
  • Previous by thread: Re: databases and bool values
  • Next by thread: Dynamic images broken
  • Index(es):
    • Date
    • Thread