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

Re: Booleans


  • Subject: Re: Booleans
  • From: Kieran Kelleher <email@hidden>
  • Date: Wed, 10 Mar 2004 22:56:02 -0500

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.


  • Follow-Ups:
    • Re: Booleans
      • From: David Griffith <email@hidden>
References: 
 >Booleans (From: David Griffith <email@hidden>)

  • Prev by Date: WebServices Soap Error (InvocationTargetException)
  • Next by Date: Re: WebServices Soap Error (InvocationTargetException)
  • Previous by thread: Booleans
  • Next by thread: Re: Booleans
  • Index(es):
    • Date
    • Thread