Return-Path: Delivered-To: apmail-ibatis-user-cs-archive@www.apache.org Received: (qmail 96536 invoked from network); 28 Nov 2006 11:24:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2006 11:24:43 -0000 Received: (qmail 95751 invoked by uid 500); 28 Nov 2006 11:24:52 -0000 Delivered-To: apmail-ibatis-user-cs-archive@ibatis.apache.org Received: (qmail 95738 invoked by uid 500); 28 Nov 2006 11:24:52 -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 95727 invoked by uid 99); 28 Nov 2006 11:24:52 -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:24:52 -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:24:39 -0800 Received: by wx-out-0506.google.com with SMTP id t14so1955683wxc for ; Tue, 28 Nov 2006 03:24:19 -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=N27cdSKBowGiYPTfpx9ccST7hHTY+HI8XzAsAAOa9MkZgin13Zu9yqvGxbQtyflC6kEAYQkuajnm0/6QgXjJyb0Ob5QSY02PGtkW0VZ+R7/WOvEhGUFIuW+BaklbQsXN8P0zfEH8zlcEDKbg7FtwCJ4Xn/lGXHbiWB0VwAe0GWE= Received: by 10.70.34.3 with SMTP id h3mr1535891wxh.1164713059068; Tue, 28 Nov 2006 03:24:19 -0800 (PST) Received: by 10.70.105.7 with HTTP; Tue, 28 Nov 2006 03:24:19 -0800 (PST) Message-ID: <32163a230611280324w5d5350del15f27fbf197583ed@mail.gmail.com> Date: Tue, 28 Nov 2006 11:24:19 +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_4027_28809761.1164713059028" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_4027_28809761.1164713059028 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline When I'm using my class as a resultclass i'm only getting null values :( On 28/11/06, Nikhil Vaghela 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_4027_28809761.1164713059028 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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_4027_28809761.1164713059028--