You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by srinu rao <sr...@hotmail.com> on 2003/08/18 11:19:11 UTC

[commons-beanutils] convert utils

Hi Craig

i have a requirement like this when i get the data from data base and set
the data to dyna beans then for any data type i want to convert null value
to empty string("") or ("(null)") like this. but i don't want this to be
happen when i am setting it to database. is there any way that i can specify
while doing copy property to specify what value to be replaced for "null".

Thanks
Srinu

_________________________________________________________________
Access Hotmail from your mobile now. 
http://server1.msn.co.in/sp03/mobilesms/ Click here.


Re: [commons-beanutils] convert utils

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
there is no simple switch but i think that it is possible.

you can change the behaviour by registering new converters with 
ConvertUtils.

if you want to vary the behaviour from dynabeans to database then you'll 
need to upgrade to CVS HEAD which contains the latest beanified code. 
create a new BeanUtilsBean instance which will be shared by the database 
conversions and register the new converters with that instance.

hope this helps.

- robert

On Monday, August 18, 2003, at 10:19 AM, srinu rao wrote:

> Hi Craig
>
> i have a requirement like this when i get the data from data base and set
> the data to dyna beans then for any data type i want to convert null value
> to empty string("") or ("(null)") like this. but i don't want this to be
> happen when i am setting it to database. is there any way that i can 
> specify
> while doing copy property to specify what value to be replaced for "null"
> .
>
> Thanks
> Srinu
>
> _________________________________________________________________
> Access Hotmail from your mobile now. 
> http://server1.msn.co.in/sp03/mobilesms/ Click here.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>