[coldbox 3.8] setting a value to NULL

81 views
Skip to first unread message

Jason Morris

unread,
Jul 16, 2015, 8:34:53 PM7/16/15
to col...@googlegroups.com
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. https://groups.google.com/forum/#!searchin/coldbox/null/coldbox/esuuqFUcctU/IYGPDN_ECJoJ

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

Luis Majano

unread,
Jul 17, 2015, 11:17:41 AM7/17/15
to col...@googlegroups.com, col...@googlegroups.com
Jason, it might be the getter issue.  Where the getter is expecting an int argument, but you are passing another type.


--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/86b16357-570d-4ddc-9ed4-d9f9afba6207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Morris

unread,
Jul 18, 2015, 2:34:37 AM7/18/15
to col...@googlegroups.com


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

Luis Majano

unread,
Jul 20, 2015, 11:23:15 AM7/20/15
to col...@googlegroups.com, col...@googlegroups.com
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.

On Thu, Jul 16, 2015 at 7:34 PM, Jason Morris <jason.mor...@gmail.com> wrote:

--

Jason Morris

unread,
Jul 24, 2015, 1:47:06 AM7/24/15
to ColdBox Platform, lma...@gmail.com
Worked exactly as needed!  Thanks Luis!
Reply all
Reply to author
Forward
0 new messages