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

Re: booleans and postgresql


  • Subject: Re: booleans and postgresql
  • From: Lachlan Deck <email@hidden>
  • Date: Thu, 10 Jan 2008 14:45:08 +1100

On 09/01/2008, at 1:59 AM, Theodore Petrosky wrote:

A while ago while working in in XCode (2.4.1) i was
able to map my booleans from my postgresql backend
like this:

{
            adaptorValueConversionMethodName =
toString;
            allowsNull = Y;
            columnName = isactive;
            externalType = varchar;
            factoryMethodArgumentType =
EOFactoryMethodArgumentIsNSString;
            name = isactive;
            valueClassName = Boolean;
            valueFactoryMethodName = "valueOf:";
            width = 5;
        },

Did you try the (much simpler) method of using an smallint field and setting the value type to c?
e.g.,
{
allowsNull = Y;
columnName = isActive;
externalType = smallint;
name = isActive;
valueClassName = NSNumber;
valueType = c;
}


Then using EOGenerator (or later equivalent) to generate your eo methods like:
public Boolean isActive() {
...
}
public void setIsActive(Boolean value) {
...
}


See EOModeler User Guide (not sure where this info is for 5.4):
- Working with Attributes > More about Attribute characteristics > Value Type.
http://developer.apple.com/documentation/WebObjects/UsingEOModeler/ 4WorkingWithAttributes/chapter_4_section_3.html#//apple_ref/doc/uid/ TP30001018-CH204-BABFGECE


this worked fine..... (maybe there is a better way but
for my needs it was fine.)

when I try to do this in eclipse  (WO 5.4) I get this
error:

Error:	 java.lang.reflect.InvocationTargetException
Reason:	 java.lang.NoSuchMethodException: Class
java.lang.Boolean does not implement method valueOf

Is there an example out there somewhere that shows a
good way to use these boolean values from my
postgresql backend.

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


References: 
 >booleans and postgresql (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: What's a good way to handle orders?
  • Next by Date: Re: Can't retrieve cookies
  • Previous by thread: Re: booleans and postgresql
  • Next by thread: [OT] New Xserves are out
  • Index(es):
    • Date
    • Thread