• 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: EOModeler and boolean
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOModeler and boolean


  • Subject: Re: EOModeler and boolean
  • From: Lachlan Deck <email@hidden>
  • Date: Tue, 24 Apr 2007 11:23:05 +1000

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


  • Follow-Ups:
    • Re: EOModeler and boolean
      • From: Kieran Kelleher <email@hidden>
References: 
 >EOModeler and boolean (From: WIESEN Bruno <email@hidden>)
 >Re: EOModeler and boolean (From: Kieran Kelleher <email@hidden>)

  • Prev by Date: Re: Help: a boolean attribute always saves as null
  • Next by Date: Re: valueForBindings
  • Previous by thread: Re: EOModeler and boolean
  • Next by thread: Re: EOModeler and boolean
  • Index(es):
    • Date
    • Thread