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

Activity

Show:
Joel Watson
June 6, 2013, 5:50 AM

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

Luis Majano
June 6, 2013, 12:35 PM

Awesome. 

Sent from Mailbox for iPhone

Fixed

Assignee

Luis Majano

Reporter

Joel Watson

Labels

None

Components

Fix versions

Priority

Minor
Configure