Return-Path: Delivered-To: apmail-ibatis-user-cs-archive@www.apache.org Received: (qmail 99293 invoked from network); 28 Nov 2006 11:34:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2006 11:34:52 -0000 Received: (qmail 9437 invoked by uid 500); 28 Nov 2006 11:35:02 -0000 Delivered-To: apmail-ibatis-user-cs-archive@ibatis.apache.org Received: (qmail 9244 invoked by uid 500); 28 Nov 2006 11:35:01 -0000 Mailing-List: contact user-cs-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-cs@ibatis.apache.org Delivered-To: mailing list user-cs@ibatis.apache.org Received: (qmail 9230 invoked by uid 99); 28 Nov 2006 11:35:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 03:35:01 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jakub.scheibe@gmail.com designates 66.249.82.235 as permitted sender) Received: from [66.249.82.235] (HELO wx-out-0506.google.com) (66.249.82.235) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 03:34:48 -0800 Received: by wx-out-0506.google.com with SMTP id t14so1957724wxc for ; Tue, 28 Nov 2006 03:34:28 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ovAJqvQQaqUR8YqxP2thQ4A4/wQwiPKWBxTDjKhGWd2j6BvDFk8iiVYsE5gwjCC2o7cWzzF7745Q8lTiS4N/3GtTgcjICKtYx4TYoP26ZGbtUVNJTUGN/EnIUXR9P3jDBkgDXCHP4p2J6xvlIyzWAN1GQlLwBsl/Tn13lekaw9Q= Received: by 10.70.131.20 with SMTP id e20mr1514652wxd.1164713668011; Tue, 28 Nov 2006 03:34:28 -0800 (PST) Received: by 10.70.105.7 with HTTP; Tue, 28 Nov 2006 03:34:27 -0800 (PST) Message-ID: <32163a230611280334h3d88bffv5fa0d08307a2c0e9@mail.gmail.com> Date: Tue, 28 Nov 2006 11:34:27 +0000 From: "Jakub Scheibe" To: user-cs@ibatis.apache.org Subject: Re: Dynamic ResultMaps In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4063_22559287.1164713667974" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_4063_22559287.1164713667974 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Here is my class public class MyClass { private string _ID; public string ID { get { return _ID; } set { _ID = value; } } private string _Name; public string Name { get { return _Name; } set { _Name = value; } } } here is my sql As a result I have only nulls. Can u verify what may be wrong? May be I'm blind or too something but I don't have any clue what's wrong with that ... Cheers, Jakub. On 28/11/06, Nikhil Vaghela wrote: > > Make sure that your public property name and the columns which you are > retrieving from the query has got same names. Then it definitely works. > > > > Nikhil Vaghela > > V2Solutions > > A New Vision to Solutions > > India: +91-22-56733201 ext 619 > > US : 1-408-454-6051 ext 219 > > http://www.v2solutions.com > > TZ : +5:30 GMT > > > ------------------------------ > > *From:* Jakub Scheibe [mailto:jakub.scheibe@gmail.com] > *Sent:* Tuesday, November 28, 2006 4:54 PM > *To:* user-cs@ibatis.apache.org > *Subject:* Re: Dynamic ResultMaps > > > > When I'm using my class as a resultclass i'm only getting > null values :( > > On 28/11/06, *Nikhil Vaghela* < nikhil.vaghela@in.v2solutions.com> wrote: > > Hi , > > > > In such situation you can use resultClass instead of resultMap , and in > that case you should have your property [in your custom objects] names same > as your query's fields name. > > > > Nikhil. > ------------------------------ > > *From:* Jakub Scheibe [mailto:jakub.scheibe@gmail.com] > *Sent:* Tuesday, November 28, 2006 4:42 PM > *To:* user-cs@ibatis.apache.org > *Subject:* Dynamic ResultMaps > > > > Hi, > > Is there any way to create dynamic resultmaps? > In this moment i'm preparing dynamic sql statement but I don't know how to > prepare dynamic resultmap > > Here is how i'm doing this: > > > > if I use following resultmap it working ok but i need to use both Id and > Name in Select > > > > > > > Regards, > Jakub > > > ------=_Part_4063_22559287.1164713667974 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Here is my class

    public class MyClass
    {
   
        private string _ID;
        public string ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        private string _Name;
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
    }

here is my sql

        <select id="Select" parameterclass="MyClass" resultclass="MyClass">
            select
            <dynamic>
                <isEqual property="Id" compareValue="1">
                    ID
                </isEqual>
                <isEqual property="Name" compareValue="true" prepend=",">
                    NAME
                </isEqual>
            </dynamic>
            from MYTBL
        </select>       

As a result I have only nulls.
Can u verify what may be wrong?
May be I'm blind or too something but I don't have any clue what's wrong with that ...

Cheers,
Jakub.


On 28/11/06, Nikhil Vaghela <nikhil.vaghela@in.v2solutions.com> wrote:

Make sure that your public property name and the columns which you are retrieving from the query has got same names. Then it definitely works.

 

Nikhil Vaghela

V2Solutions 
A New Vision to Solutions 

India: +91-22-56733201 ext 619

US : 1-408-454-6051  ext 219

http://www.v2solutions.com 
TZ : +5:30 GMT

 


From: Jakub Scheibe [mailto:jakub.scheibe@gmail.com]
Sent: Tuesday, November 28, 2006 4:54 PM
To: user-cs@ibatis.apache.org
Subject: Re: Dynamic ResultMaps

 

When I'm using my class as a resultclass i'm only getting
null values :(

On 28/11/06, Nikhil Vaghela < nikhil.vaghela@in.v2solutions.com> wrote:

Hi ,

 

In such situation you can use resultClass instead of resultMap , and in that case you should have your property [in your custom objects] names same as your query's fields name.

 

Nikhil.


From: Jakub Scheibe [mailto: jakub.scheibe@gmail.com]
Sent: Tuesday, November 28, 2006 4:42 PM
To: user-cs@ibatis.apache.org
Subject: Dynamic ResultMaps

 

Hi,

Is there any way to create dynamic resultmaps?
In this moment i'm preparing dynamic sql statement but I don't know how to prepare dynamic resultmap

Here is how i'm doing this:

        <select id="Select" parameterclass="MyClass" resultmap="MyResMap">
            select
            <dynamic>
                <isEqual property="Id" compareValue="1">
                    ID
                </isEqual>
                <isEqual property="Name" compareValue="true" prepend=",">
                    NAME
                </isEqual>
            </dynamic>
            from MYTBL
        </select>       

if I use following resultmap it working ok but i need to use both Id and Name in Select

        <resultMap id="MyResMap">
                <result property="Id" column="ID"/>
                <result property="Name" column="Name"/>
        </resultMap>

Regards,
Jakub

 


------=_Part_4063_22559287.1164713667974--