[coldbox 3.8] setting a value to NULL

We are using the populate method of the Coldbox OrmService.

When trying to update an INT property with an empty string, or NULL, or javacast``(``'NULL'``, ``''``), we get the following error for each of these.

The value ‘’ cannot be converted to a number

I was able to find this posting, which is basically the issue we are having, but it doesn’t appear to have a resolution. Google Groups

Does anyone know of how we can get around this limitation of the OrmService? It’s rather frustrating as you would expect it to be a reasonably common requirement.

Thanks in advance!

Jason

Jason, it might be the getter issue. Where the getter is expecting an int argument, but you are passing another type.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

Thanks Luis, correct. I am trying to update an INT field to NULL.

Using the CF ORM directly I would be able to do this by setting the field to javacast``(``'NULL'``, ``''``), or if doing straight SQL I can just set it to NULL, but I am using Coldbox's ORMService which throws an error when attempting to update either of these.. therefore the question..

How do I update an INT type field to NULL using Coldbox Orm Services?

Thanks again Luis!!

Jason

Make sure you use the nullEmptyInclude - A list of keys to NULL when empty
argument. You need to tell the populator which fields to null out if empty.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

Worked exactly as needed! Thanks Luis!