commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: beanutils copy to ignore null properties
Date Mon, 13 Oct 2008 22:13:23 GMT
On Mon, Oct 13, 2008 at 7:25 PM, miro <miroconnect@yahoo.com> wrote:
>
> I have Bean Test
> with properties   A and B
>
> An instance of  Test  TestA has value for A   and B is null.
> another intance of Test  TestB  has value for B and A is null .
> now  when I call copyProperties BeanUtils.copyProperties(TestA, TestB)
> TestA
>  property A will get null
> and Propetrty B will be B
>
> instead I want beanUtils to update TestA      just by copying non null
> properties is it possible ?

This isn't provided by BeanUtils, but you could use BeanUtils to build
this kind of *merge" functionality.

Niall

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message