ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MCCORMICK, Paul" <Paul.McCORM...@doir.wa.gov.au>
Subject RE: Nested Bean in Result Map
Date Fri, 18 Aug 2006 07:03:52 GMT

If you have a nested bean then use a nested result map.  You will need
to use the 2.2.0 beta release.  It wont work with 2.1.7.

<resultMap id="NestedBeanRM" class="PageBean">
 <result property="address1"  column="ADDRESS1" />
 <result property="address2"  column="ADDRESS2" />
</resultMap>

<resultMap id="PageBeanRM" class="PageBean">
 <result property="id"  column="ID" />
 <result property="detail"  resultMap="NestedBeanRM" />
</resultMap>
Paul


________________________________

From: kiran.gutta@wipro.com [mailto:kiran.gutta@wipro.com]
Sent: Friday, 18 August 2006 2:43 PM
To: user-java@ibatis.apache.org
Subject: Nested Bean in Result Map


Hi,

I have a bean as shown below.

class PageBean{
    int id;
    NestedBean detail;
    String name;
}

class NestedBean{
    String address1;
    String address2;
}

I have table with following columns.
ID, NAME, ADDRESS1, ADDRESS2

How to set the result map for the PageBean?

Thanks & Regards,
Kiran



The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.

www.wipro.com



"DISCLAIMER: This email, including any attachments, is intended only for use by the addressee(s)
and may contain confidential and/or personal information and may also be the subject of legal
privilege. If you are not the intended recipient, you must not disclose or use the information
contained in it. In this case, please let me know by return email, delete the message permanently
from your system and destroy any copies.

Before you take any action based upon advice and/or information contained in this email you
should carefully consider the advice and information and consider obtaining relevant independent
advice.
Mime
View raw message