You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Graham Lounder <gr...@caris.com> on 2004/08/10 19:50:16 UTC
[beanutils] copyProperties and Hibernate lazy collections
Hey All,
I'm having problems with BeanUtils.copyProperties() and hibernate's lazy
collections. Almost all my list in hibernate are setup as lazy list so
they will only be populated when they are refereneced for the first
time. This has been working great so far but as soon as I try to copy
on of my objects to an ActionForm, it runs out of memory. I'm assuming
that the copy Properties method is going into the lazy collections and
initializing them (which I don't want to happen).
Is there any way to tell BeanUtils to only copy Simple Properties? Or
is there a way to get it to ignore properties that return a List object?
Cheers,
Graham
--
======================================================================
Graham Lounder - Java Developer
Spatial Components Division
CARIS www.caris.com
Tel: +1-506-458-8533 Fax: +1-506-459-3849
115 Waggoner's Lane, Fredericton, New Brunswick, E3B 2L4, Canada.
CARIS 2004 - Where Waterways Meet
9th International User Group Conference and Educational Sessions
22-25 November 2004, Hotel Hafen Hamburg, Hamburg, Germany
Visit www.caris.com/caris2004 or e-mail caris2004@caris.nl for more.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [beanutils] copyProperties and Hibernate lazy collections
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi graham
(hopefully this is better late than never...)
i'd suggest subclassing BeanUtilsBean, subclassing copyProperties so
that it works the way you want. then register your new instance early
in the lifecycle of your application.
- robert
On 10 Aug 2004, at 18:50, Graham Lounder wrote:
> Hey All,
>
> I'm having problems with BeanUtils.copyProperties() and hibernate's
> lazy collections. Almost all my list in hibernate are setup as lazy
> list so they will only be populated when they are refereneced for the
> first time. This has been working great so far but as soon as I try
> to copy on of my objects to an ActionForm, it runs out of memory. I'm
> assuming that the copy Properties method is going into the lazy
> collections and initializing them (which I don't want to happen).
>
> Is there any way to tell BeanUtils to only copy Simple Properties? Or
> is there a way to get it to ignore properties that return a List
> object?
>
> Cheers,
> Graham
>
> --
> ======================================================================
> Graham Lounder - Java Developer
> Spatial Components Division
>
> CARIS www.caris.com
> Tel: +1-506-458-8533 Fax: +1-506-459-3849 115 Waggoner's Lane,
> Fredericton, New Brunswick, E3B 2L4, Canada.
>
> CARIS 2004 - Where Waterways Meet
> 9th International User Group Conference and Educational Sessions
> 22-25 November 2004, Hotel Hafen Hamburg, Hamburg, Germany
> Visit www.caris.com/caris2004 or e-mail caris2004@caris.nl for more.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org