You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Niall Pemberton <ni...@gmail.com> on 2008/10/14 00:13:23 UTC

Re: beanutils copy to ignore null properties

On Mon, Oct 13, 2008 at 7:25 PM, miro <mi...@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