Re: [Wonder-disc] OpenBase / boolean / ERPrototypes
please file a radar with the patch ... On Mar 9, 2009, at 12:38 AM, Ricardo J. Parada wrote: Thanks Mike... Well... I went inside EOJDBCOpenBasePrototypes.plist and I replaced the definition for the intBoolean by the one for FrontBase (which I know works), except that I changed the external type from INTEGER to int because that's what all other integer prototypes for OpenBase seem to use. And... NOW IT WORKS!!! Ok... so here's the definition I ended up using which finally works with OpenBase: { columnName = ; externalType = int; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = intBoolean; valueClassName = NSNumber; valueType = c; }, By the way, this definition also works if I go into the OpenBaseManager and change the column type from integer to boolean. Should this be checked in back into Wonder? Otherwise next time I upgrade to the latest Wonder I'll have to patch it again. :-) Ricardo On Mar 8, 2009, at 11:17 PM, Mike Schrag wrote: Not sure I understood what you mean by flag. :-) there is a prototype named flag that maps onto whatever your database considers a bit type -- if your database natively supports a boolean type, this is the one you would use, though there are good odds the definition is wrong for OB Anyways, here's the boolean protototype from ERPrototypes as defined in EOJDBCOpenBasePrototypes.plist: yes, this is the varchar(5) boolean type that turns into the strings true or false in the database. and the intBoolean prototype is setup as follows: { adaptorValueConversionMethodName = toString; columnName = ; externalType = bool; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = intBoolean; valueClassName = NSNumber; valueFactoryMethodName = valueOf; valueType = c; }, You're setting this up wrong .. you should look at the other databases versions of this in ERP ... you don't have/need a valueFactoryMethodName and a conversion method name for integer types .. it's much easier than that. I've been trying all kinds of things to get these booleans to work... And I just thought of one which might work. I'll change the type in openbase for those columns back to integer type. Then I'll use the intBoolean prototype from ERPrototypes. I assume that's what the intBoolean prototype is for: to have a boolean in your EO stored as an integer in the database. Right? yes, though again, if you're using the boolean type, you're probably not going to want intBoolean (though it may work by accident). ms -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Wonder-disc mailing list wonder-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wonder-disc -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Wonder-disc mailing list wonder-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wonder-disc ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [Wonder-disc] OpenBase / boolean / ERPrototypes
Ricardo: I use OpenBase and have boolean columns. I have mine modeled like the first boolean prototype below. The prototype sets the valueType to String and uses toString() to convert the java boolean to a 5 character varchar in the database (for false). The result is that it actually writes true or false (String) to the database. So, your column type in OpenBase should not be boolean, it should be varchar, 5. I haven't used the approach of the intBoolean prototype. I am not using the WOnder prototypes but Practical WebObjects also describes modeling booleans in this fashion - which I like. Tim UCLA GSEIS On Mar 8, 2009, at 3:25 PM, Ricardo J. Parada wrote: Hi Mike, Not sure I understood what you mean by flag. :-) Anyways, here's the boolean protototype from ERPrototypes as defined in EOJDBCOpenBasePrototypes.plist: { adaptorValueConversionMethodName = toString; columnName = ; externalType = varchar; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = boolean; valueClassName = java.lang.Boolean; valueFactoryMethodName = valueOf; valueType = S; width = 5; }, and the intBoolean prototype is setup as follows: { adaptorValueConversionMethodName = toString; columnName = ; externalType = bool; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = intBoolean; valueClassName = NSNumber; valueFactoryMethodName = valueOf; valueType = c; }, I tried both and neither one works for me. Anybody out there using OpenBase 10.0.11 with and boolean properties in your columns and EOs? I've been trying all kinds of things to get these booleans to work... And I just thought of one which might work. I'll change the type in openbase for those columns back to integer type. Then I'll use the intBoolean prototype from ERPrototypes. I assume that's what the intBoolean prototype is for: to have a boolean in your EO stored as an integer in the database. Right? On Mar 8, 2009, at 10:20 AM, Mike Schrag wrote: boolean in erp = varchar, not boolean, intBoolean in erp = number, flag = probably what OB is calling boolean, but you'd have to check if the OB variant of erp declares this properly. ms On Mar 8, 2009, at 3:06 AM, Ricardo J. Parada wrote: Hi All, There seems to be something wrong with booleans when using OpenBase and ERPrototypes. In OpenBaseManager the column type for my column says boolean: Picture 2.png In openisql (command line) I can query like this: select count(*) from cliente where suspendido = true of like this: select count(*) from cliente where suspendido = 1 In entity modeler, if I configure my attribute using the boolean prototype from ERPrototypes as shown below, then the queries don't return the right number of rows. The update statements generated by EOF don't work either (even though they look right). If I model my attribute as an integer then the queries work okay and the update statements issued by EOF work too. By I don't like having an Integer in my accessor methods in my EO for a boolean column. I want to use boolean. Looking at the screenshot below, does this look like the boolean prototype is setting the fields correctly for a boolean column in OpenBase? Anybody wants to guess? Anybody using booleans in OpenBase and ERPrototypes? Picture 1.png -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Wonder-disc mailing list wonder-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wonder-disc -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Wonder-disc mailing list wonder-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wonder-disc ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription:
Re: [Wonder-disc] OpenBase / boolean / ERPrototypes
boolean in erp = varchar, not boolean, intBoolean in erp = number, flag = probably what OB is calling boolean, but you'd have to check if the OB variant of erp declares this properly. ms On Mar 8, 2009, at 3:06 AM, Ricardo J. Parada wrote: Hi All, There seems to be something wrong with booleans when using OpenBase and ERPrototypes. In OpenBaseManager the column type for my column says boolean: Picture 2.png In openisql (command line) I can query like this: select count(*) from cliente where suspendido = true of like this: select count(*) from cliente where suspendido = 1 In entity modeler, if I configure my attribute using the boolean prototype from ERPrototypes as shown below, then the queries don't return the right number of rows. The update statements generated by EOF don't work either (even though they look right). If I model my attribute as an integer then the queries work okay and the update statements issued by EOF work too. By I don't like having an Integer in my accessor methods in my EO for a boolean column. I want to use boolean. Looking at the screenshot below, does this look like the boolean prototype is setting the fields correctly for a boolean column in OpenBase? Anybody wants to guess? Anybody using booleans in OpenBase and ERPrototypes? Picture 1.png -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Wonder-disc mailing list wonder-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wonder-disc ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [Wonder-disc] OpenBase / boolean / ERPrototypes
Hi Mike, Not sure I understood what you mean by flag. :-) Anyways, here's the boolean protototype from ERPrototypes as defined in EOJDBCOpenBasePrototypes.plist: { adaptorValueConversionMethodName = toString; columnName = ; externalType = varchar; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = boolean; valueClassName = java.lang.Boolean; valueFactoryMethodName = valueOf; valueType = S; width = 5; }, and the intBoolean prototype is setup as follows: { adaptorValueConversionMethodName = toString; columnName = ; externalType = bool; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = intBoolean; valueClassName = NSNumber; valueFactoryMethodName = valueOf; valueType = c; }, I tried both and neither one works for me. Anybody out there using OpenBase 10.0.11 with and boolean properties in your columns and EOs? I've been trying all kinds of things to get these booleans to work... And I just thought of one which might work. I'll change the type in openbase for those columns back to integer type. Then I'll use the intBoolean prototype from ERPrototypes. I assume that's what the intBoolean prototype is for: to have a boolean in your EO stored as an integer in the database. Right? On Mar 8, 2009, at 10:20 AM, Mike Schrag wrote: boolean in erp = varchar, not boolean, intBoolean in erp = number, flag = probably what OB is calling boolean, but you'd have to check if the OB variant of erp declares this properly. ms On Mar 8, 2009, at 3:06 AM, Ricardo J. Parada wrote: Hi All, There seems to be something wrong with booleans when using OpenBase and ERPrototypes. In OpenBaseManager the column type for my column says boolean: Picture 2.png In openisql (command line) I can query like this: select count(*) from cliente where suspendido = true of like this: select count(*) from cliente where suspendido = 1 In entity modeler, if I configure my attribute using the boolean prototype from ERPrototypes as shown below, then the queries don't return the right number of rows. The update statements generated by EOF don't work either (even though they look right). If I model my attribute as an integer then the queries work okay and the update statements issued by EOF work too. By I don't like having an Integer in my accessor methods in my EO for a boolean column. I want to use boolean. Looking at the screenshot below, does this look like the boolean prototype is setting the fields correctly for a boolean column in OpenBase? Anybody wants to guess? Anybody using booleans in OpenBase and ERPrototypes? Picture 1.png -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Wonder-disc mailing list wonder-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wonder-disc -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Wonder-disc mailing list wonder-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wonder-disc ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [Wonder-disc] OpenBase / boolean / ERPrototypes
Hmmm... I tried changing the column type in openbase to an integer and saved the change. Then I deleted my EOAttribute from my entity and added it back, this time using intBoolean. But as soon as I fetch my EO from the database it blows up with the following exception: er.transaction.adaptor.Exceptions - Database Exception occured: com.webobjects.foundation.NSForwardException [java.lang.NoSuchMethodException] Class java.lang.Number does not implement method valueOf:java.lang.NoSuchMethodException: Class java.lang.Number does not implement method valueOf The query looks right though. It just seems that the EOAttribute is having trouble converting the value from the database to the type used in the EO. [2009-3-8 18:42:3 EDT] WorkerThread0 com.webobjects.foundation.NSForwardException [java.lang.NoSuchMethodException] Class java.lang.Number does not implement method valueOf:java.lang.NoSuchMethodException: Class java.lang.Number does not implement method valueOf at com .webobjects .foundation .NSForwardException ._runtimeExceptionForThrowable(NSForwardException.java:41) at com.webobjects.eoaccess.EOAttribute.newValueForString(EOAttribute.java: 2003) at com .webobjects.jdbcadaptor.JDBCColumn._newValueForString(JDBCColumn.java: 675) at com .webobjects.jdbcadaptor.JDBCColumn._fetchCorrectObject(JDBCColumn.java: 334) at com.webobjects.jdbcadaptor.JDBCColumn._fetchValue(JDBCColumn.java: 384) at com.webobjects.jdbcadaptor.JDBCColumn.fetchValue(JDBCColumn.java: 372) at com.webobjects.jdbcadaptor.JDBCChannel.fetchRow(JDBCChannel.java: 1462) at com .webobjects .eoaccess.EODatabaseChannel._fetchObject(EODatabaseChannel.java:321) at com .webobjects .eoaccess .EODatabaseContext ._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java: 3071) at com .webobjects .eoaccess .EODatabaseContext .objectsWithFetchSpecification(EODatabaseContext.java:3195) at com .webobjects .eocontrol .EOObjectStoreCoordinator .objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488) at com .webobjects .eocontrol .EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java: 4069) at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java: 1114) at com .webobjects .eocontrol .EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java: ) at com.paradacafe.model._Cliente.fetchBusqueda(_Cliente.java:516) at com .paradacafe .webapps .admin.components.ClientesBusqueda.buscar(ClientesBusqueda.java:132) [...snip...] at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:92) at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357) at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java: 1745) at er .extensions .appserver .ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:49) at er .extensions.appserver.ERXApplication.invokeAction(ERXApplication.java: 1622) [...snip...] On Mar 8, 2009, at 6:25 PM, Ricardo J. Parada wrote: Hi Mike, Not sure I understood what you mean by flag. :-) Anyways, here's the boolean protototype from ERPrototypes as defined in EOJDBCOpenBasePrototypes.plist: { adaptorValueConversionMethodName = toString; columnName = ; externalType = varchar; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = boolean; valueClassName = java.lang.Boolean; valueFactoryMethodName = valueOf; valueType = S; width = 5; }, and the intBoolean prototype is setup as follows: { adaptorValueConversionMethodName = toString; columnName = ; externalType = bool; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = intBoolean; valueClassName = NSNumber; valueFactoryMethodName = valueOf; valueType = c; }, I tried both and neither one works for me. Anybody out there using OpenBase 10.0.11 with and boolean properties in your columns and EOs? I've been trying all kinds of things to get these booleans to work... And I just thought of one which might work. I'll change the type in openbase for those columns back to integer type. Then I'll use the intBoolean prototype from ERPrototypes. I assume that's what the intBoolean prototype is for: to have a boolean in your EO stored as an integer in the database. Right? On Mar 8, 2009, at 10:20 AM, Mike Schrag wrote: boolean in erp = varchar, not boolean, intBoolean in erp = number, flag = probably what OB is calling boolean, but you'd have to check if the OB variant of erp declares this properly. ms On Mar 8, 2009, at 3:06 AM, Ricardo J. Parada wrote: Hi All, There seems to be something wrong with booleans when using
Re: [Wonder-disc] OpenBase / boolean / ERPrototypes
Not sure I understood what you mean by flag. :-) there is a prototype named flag that maps onto whatever your database considers a bit type -- if your database natively supports a boolean type, this is the one you would use, though there are good odds the definition is wrong for OB Anyways, here's the boolean protototype from ERPrototypes as defined in EOJDBCOpenBasePrototypes.plist: yes, this is the varchar(5) boolean type that turns into the strings true or false in the database. and the intBoolean prototype is setup as follows: { adaptorValueConversionMethodName = toString; columnName = ; externalType = bool; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = intBoolean; valueClassName = NSNumber; valueFactoryMethodName = valueOf; valueType = c; }, You're setting this up wrong .. you should look at the other databases versions of this in ERP ... you don't have/need a valueFactoryMethodName and a conversion method name for integer types .. it's much easier than that. I've been trying all kinds of things to get these booleans to work... And I just thought of one which might work. I'll change the type in openbase for those columns back to integer type. Then I'll use the intBoolean prototype from ERPrototypes. I assume that's what the intBoolean prototype is for: to have a boolean in your EO stored as an integer in the database. Right? yes, though again, if you're using the boolean type, you're probably not going to want intBoolean (though it may work by accident). ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [Wonder-disc] OpenBase / boolean / ERPrototypes
Thanks Mike... Well... I went inside EOJDBCOpenBasePrototypes.plist and I replaced the definition for the intBoolean by the one for FrontBase (which I know works), except that I changed the external type from INTEGER to int because that's what all other integer prototypes for OpenBase seem to use. And... NOW IT WORKS!!! Ok... so here's the definition I ended up using which finally works with OpenBase: { columnName = ; externalType = int; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = intBoolean; valueClassName = NSNumber; valueType = c; }, By the way, this definition also works if I go into the OpenBaseManager and change the column type from integer to boolean. Should this be checked in back into Wonder? Otherwise next time I upgrade to the latest Wonder I'll have to patch it again. :-) Ricardo On Mar 8, 2009, at 11:17 PM, Mike Schrag wrote: Not sure I understood what you mean by flag. :-) there is a prototype named flag that maps onto whatever your database considers a bit type -- if your database natively supports a boolean type, this is the one you would use, though there are good odds the definition is wrong for OB Anyways, here's the boolean protototype from ERPrototypes as defined in EOJDBCOpenBasePrototypes.plist: yes, this is the varchar(5) boolean type that turns into the strings true or false in the database. and the intBoolean prototype is setup as follows: { adaptorValueConversionMethodName = toString; columnName = ; externalType = bool; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; name = intBoolean; valueClassName = NSNumber; valueFactoryMethodName = valueOf; valueType = c; }, You're setting this up wrong .. you should look at the other databases versions of this in ERP ... you don't have/need a valueFactoryMethodName and a conversion method name for integer types .. it's much easier than that. I've been trying all kinds of things to get these booleans to work... And I just thought of one which might work. I'll change the type in openbase for those columns back to integer type. Then I'll use the intBoolean prototype from ERPrototypes. I assume that's what the intBoolean prototype is for: to have a boolean in your EO stored as an integer in the database. Right? yes, though again, if you're using the boolean type, you're probably not going to want intBoolean (though it may work by accident). ms -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Wonder-disc mailing list wonder-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wonder-disc ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
OpenBase / boolean / ERPrototypes
Hi All,There seems to be something wrong with booleans when using OpenBase and ERPrototypes.In OpenBaseManager the column type for my column says boolean:In openisql (command line) I can query like this:select count(*) from cliente where suspendido = trueof like this:select count(*) from cliente where suspendido = 1In entity modeler, if I configure my attribute using the boolean prototype fromERPrototypes as shown below, then the queries don't return the right number of rows. The update statements generated by EOF don't work either (even though they look right). If I model my attribute as an integer then the queries work okay and the update statements issued by EOF work too. By I don't like having an Integer in my accessor methods in my EO for a boolean column. I want to use boolean.Looking at the screenshot below, does this look like the boolean prototype is setting the fields correctly for a boolean column in OpenBase? Anybody wants to guess? Anybody using booleans in OpenBase and ERPrototypes? ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com