Re: EOModeler and boolean
Re: EOModeler and boolean
- Subject: Re: EOModeler and boolean
- From: Kieran Kelleher <email@hidden>
- Date: Mon, 23 Apr 2007 22:07:27 -0400
IIRC, there was a time when SMALLINT/c was troublesome in past
versions of WO .... might be fixed now, no interest in pursuing the
history of it right now ........ I like the char(5) boolean, however
for huge table performance, it definitely is worth considering a
small int.
In any case, this thread began with someone having difficulty with
boolean modeling. Works in development and does not in deployment....
IMHO, the char(5) solution always works and is totally bulletproof
and trouble free for every database vendor ..... but there are many
ways to skin a cat, so whatever works. If Bruno continues having
problems with boolean modeling of an int, then better to spend 2
minutes implementing the char(5) and be done with it so he can get
his project progressing rather than spend hours trying to figure why
a boolean int works in dev and not in deployment. Just my
opinion..... but for sure not a rule by any means.
On Apr 23, 2007, at 9:23 PM, Lachlan Deck wrote:
Hi there,
On 24/04/2007, at 12:44 AM, Kieran Kelleher wrote:
If you have control over the DB design, then don't waste your time
fiddling with ints for booleans.
Why not? They work very well.
Use the database vendor independent boolean prototype that uses
the strings 'true' and 'false' in the db and converts on the fly
in and out of the DB to Boolean objects.
BOOL is not standard sql. Simply use SMALLINT which is standard
sql... and set the valueType = 'c'. See the EOModeler User Guide >
Working With Attributes > More About Attribute Characteristics >
Value Type:
http://developer.apple.com/referencelibrary/DeveloperTools/
idxWebObjects-date.html
Here's a usual example that works perfectly:
{
allowsNull = Y;
columnName = isDeleted;
externalType = SMALLINT;
name = isDeleted;
valueClassName = NSNumber;
valueType = c;
},
Why bother creating a varchar column for something simple? But
certainly using prototypes is recommended...
with regards,
--
Lachlan Deck
_______________________________________________
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