ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <lmead...@apache.org>
Subject Re: N+1 selects resultMap list is not serializable
Date Sat, 14 Jan 2006 03:27:01 GMT
Because whe you serialize Product, the list of Attribute objects
cannot be serialized, so...kaboom.

Make Attribute serializable, and it'll work.

Larry


On 1/13/06, Perry Nguyen <pfnguyen@hanhuy.com> wrote:
> I'm having a problem with a simple N+1 selects problem.
>
> I have some objects akin to:
>
> Product implements Serializable {
>    List attributes;
>    String id;
> }
>
> Attributes {
>    String name;
>    String value;
> }
>
> and I do something along the lines of
>
> <resultMap id="productResults" class="Product" groupBy="id">
>    <result property="id" column="PRODUCT_ID"/>
>    <result property="attributes" resultMap="Products.attributeResults"/>
> </resultMap>
>
> When I go to Serialize Product, I end up with a
> NotSerializableException.  Making 'attributes' transient makes the
> exception go away.
>
> What can I do to make the List serializable?  Or what is a way I can
> workaround this?
>
> Thanks.
>

Mime
View raw message