Re: Booleans
Re: Booleans
- Subject: Re: Booleans
- From: David Griffith <email@hidden>
- Date: Thu, 11 Mar 2004 12:46:41 +0100
Not sure if it matters, but I guess I should have mentioned that I'm using
FrontBase and WO 5.2.2.
Regards,
Dave.
> Hi,
>
> Yes, I have actually searched and read a lot of the articles on the list
> relating to booleans, although the way I have done it appeared to be one of
> the suggested ways. However it does not work.
>
> Does anyone else recommend that I change this to use a 1 and 0 in the
> database? Does this appear to be the problem?
>
> Regards,
> Dave.
>
>> Kevin,
>>
>> Look at the heading "Value Type" on this page:
>> http://developer.apple.com/documentation/WebObjects/UsingEOModeler/
>> 4WorkingWithAttributes/chapter_4_section_3.html
>>
>> Search the list archives if you wish .... you will find some previous
>> threads on this.
>>
>> Handling booleans has been discussed many times on the list and there
>> are two or three common methods of managing them. From what I can
>> remember, developers have been using 1 and 0 to represent true and
>> false at the database level. Some then map it to java.lang.Boolean
>> using 'c' as the value type just as the link above shows. Others, like
>> me, use a "cover" method ..... for example isShipped is a cover method
>> with boolean get and set for the real attribute isShippedInteger which
>> is a short int.
>>
>> Check out this link for download link for Joseph Moreno's WO
>> Conventions document which has some info on handling booleans:
>> http://homepage.mac.com/kelleherk/iblog/C1216817469/E141295339/
>> index.html
>>
>>
>> Also, the prototypes available for MySQL here may be of use:
>> http://homepage.mac.com/kelleherk/iblog/C711669388/E80430015/index.html
>>
>> -Kieran
>>
>> ________________________________________________________________
>> Config = OS X 10.3.2 / Java 1.4.1 / WO 5.2.2 / MySQL 4.0.18 /
>> Connector-J 3.0.11
>> Blog: http://webobjects.webhop.org/
>>
>>
>> On Mar 10, 2004, at 8:57 PM, David Griffith wrote:
>>
>>> HI all,
>>>
>>> I have en EOPrototype set up in my EOModel like this:
>>>
>>> Name: boolean
>>> Value Class: java.lang.Boolean
>>> Factory Method: valueOf
>>> Conversion Method: toString
>>> Init Arguament: NSString
>>>
>>> And I have just added 'c' as the value type.
>>>
>>> The value stored in the database as a result is 'true' or 'false' and
>>> it is
>>> getting stored ok.
>>>
>>> However, anytime I reference the value in code, like:
>>>
>>> orderStatus.oscIsShipped()
>>>
>>> I ALWAYS get false. No matter what. Even though it is true in the
>>> database.
>>>
>>> It's got to be something small, can someone tell me why? It's driving
>>> me
>>> crazy.
>>>
>>> Regards,
>>> Dave.
>>> _______________________________________________
>>> webobjects-dev mailing list | email@hidden
>>> Help/Unsubscribe/Archives:
>>> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>> Do not post admin requests to the list. They will be ignored.
>> _______________________________________________
>> webobjects-dev mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>> Do not post admin requests to the list. They will be ignored.
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Re: Booleans (From: David Griffith <email@hidden>) |