Re: Booleans [SOLVED]
Re: Booleans [SOLVED]
- Subject: Re: Booleans [SOLVED]
- From: David Griffith <email@hidden>
- Date: Thu, 11 Mar 2004 19:31:23 +0100
Silly, silly, silly. I just noticed the Data Type for the value in the
database was set to 'boolean', not to VARCHAR. That has fixed it (as you
would expect!).
So, a question. If FrontBase DOES support the 'boolean' type which it of
course does, then could I use a java.lang.Boolean mapped to a boolean in the
database with no specific translation? Would it convert it for me? It is
currently working with the VARCHAR(5) type in the database and the factory
and conversion methods set.
Regards,
Dave.
> Hi Chuck,
>
> Thanks for the link, had a look. Have actually read all of that on the list
> already which is fine. The 'c' value type I have just added recently to see
> if it helped, it didn't. I'm going to remove it again.
>
> The truth is, I have used the first method described in that article, as
> listed below, and it DOES NOT WORK. I am using custom classes by the way
> (as generated by EOModeler) - would that have any impact? I have not
> modified the custom class methods for this attribute. Basically, I don't
> want to go and change all the columns that are boolean to use a numeric
> format unless there is no other choice.
>
> I can use a fetchSpec with the following bindings for example:
>
> (fetch spec bindings):
> isShipped = $isShipped
>
>
> And pass it the bindings in code:
> bindings.addObject(Boolean.TRUE, "isShipped");
>
> And it will return exactly the correct records.
>
> However, if I use a relationship traversal with an array filter to try and
> locate the one I want, I get no results as the value of:
>
> someEntity.isShipped()
>
> ALWAYS returns false, no matter what, even though it is true in the
> database.
>
> Anyone else any suggestions before I go ripping my model apart and
> recreating tables???? (which have DATA!)
>
> Regards,
> Dave.
>
>> Try removing the value type. I think that c is incorrect for this
>> usage.
>> See also
>> http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main?
>> wikiPage=BooleanModeling
>>
>> Chuck
>>
>>
>>>> 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.
> _______________________________________________
> 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>) |