Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 51294 invoked from network); 23 Jan 2007 00:08:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jan 2007 00:08:11 -0000 Received: (qmail 47067 invoked by uid 500); 23 Jan 2007 00:08:15 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 47052 invoked by uid 500); 23 Jan 2007 00:08:14 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 47040 invoked by uid 99); 23 Jan 2007 00:08:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jan 2007 16:08:14 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [210.245.57.163] (HELO vips.com.vn) (210.245.57.163) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 22 Jan 2007 16:08:05 -0800 Received: (qmail 18967 invoked from network); 23 Jan 2007 07:06:28 +0700 Received: from unknown (HELO 2231523) (172.16.255.4) by vips.com.vn with SMTP; 23 Jan 2007 07:06:28 +0700 Message-ID: <007c01c73e82$7b19d6b0$04ff10ac@2231523> From: "Nguyen Trong Hoan" To: "User Ibatis" Subject: Complex properties and substitution strings parameter problem Date: Tue, 23 Jan 2007 09:07:31 +0900 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0078_01C73ECD.EA071920" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------=_NextPart_000_0078_01C73ECD.EA071920 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Hi! I'm developing a web app with ibatis (2.2) and have got a problem with complex properties and passing substitution strings parameter for sql query of properties. For example: Here, bean.User class is declared as the following: public class User { private String schema; private int id; private String name; } so, I only passed schema parameter for getUser sql, but I couldn't pass it for getAddress sql. Please help me to solve this problem. Thank you very much! ------=_NextPart_000_0078_01C73ECD.EA071920 Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable
Hi!
 
I'm developing a web app with = ibatis (2.2)=20 and have got a problem with complex properties and passing = substitution=20 strings parameter for sql query of properties.
 
For example:
 
<sqlMap namespace=3D"user">
    = <resultMap=20 id=3D"User" = class=3D"bean.User">
       =20 <result property=3D"id" column=3D"id" =20 />
        <result = property=3D"name"=20 column=3D"name" />
        <result = property=3D"address"=20 column=3D"id" select=3D"getAddress"/>
   =20 </resultMap>
        &nb= sp;       
   =20 <select id=3D"getUser" parameterClass=3D"int" =20 resultMap=3D"User">
        = SELECT=20 id,name FROM $schema$.tbl_user WHERE id =3D = #value#
   =20 </select>

    <select id=3D"getAddress"=20 parameterClass=3D"int"=20 resultClass=3D"string">
        = SELECT address FROM $schema$.tbl_address WHERE id =3D=20 #value#
    = </select>
</sqlMap>
Here, bean.User class = is declared=20 as the following:
public class User = {
    private = String=20 schema;
    private int = id;
    private = String=20 name;
}
 
so, I only passed = schema=20 parameter for getUser sql, but I couldn't pass it for=20 getAddress sql.
Please help me to solve this=20 problem.
Thank you very = much!
 
------=_NextPart_000_0078_01C73ECD.EA071920--