NULL Support in BeanPopulator

Description

There is currently no way to set a NULL via populate(). While the ignoreEmpty argument will prevent empty strings from being set on properties, it also prevents non-empty property values from being nulled (or even set to empty string).

It would be awesome to have more support in populate() to set nulls, perhaps that incorporates one or all of the following:

1.) All or nothing argument for setting nulls when empty
2.) List of properties to null/not null when empty
3.) Checks for nullable properties?

A couple of people have blogged about their solutions:

http://dustinmartin.net/cf9-orm-nulls-empty-strings-numeric-values/
http://www.danvega.org/blog/2011/6/16/ColdBox-Bean-Populator-and-ORM

Gliffy Diagrams

Activity

Show:

Luis Majano June 6, 2013 at 12:35 PM

Awesome. 

Sent from Mailbox for iPhone

Joel Watson June 6, 2013 at 5:50 AM

I have this ready to go with tests. I want to test on Railo tomorrow, and then I'll commit.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Priority

Sentry

Created May 27, 2013 at 4:14 PM
Updated December 5, 2013 at 7:56 PM
Resolved December 5, 2013 at 7:56 PM