Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 66807 invoked from network); 11 Apr 2007 15:04:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Apr 2007 15:04:09 -0000 Received: (qmail 69603 invoked by uid 500); 11 Apr 2007 15:04:13 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 69591 invoked by uid 500); 11 Apr 2007 15:04:13 -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 69580 invoked by uid 99); 11 Apr 2007 15:04:13 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2007 08:04:13 -0700 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 jeffgbutler@gmail.com designates 64.233.162.224 as permitted sender) Received: from [64.233.162.224] (HELO nz-out-0506.google.com) (64.233.162.224) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2007 08:04:06 -0700 Received: by nz-out-0506.google.com with SMTP id q3so161895nzb for ; Wed, 11 Apr 2007 08:03:45 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=pF3nx3XEwdvA8eNwA6oNURGe67MvpkcEi+xXbWPn9K7x4/tLxoUZWbHT0+S5ED4CF1c760Zz1RUfKZB44XeQy2JmZ++zz0ggs9ED7KW4BHdE1BadYegrCR60i7aGypozDGR5g5pDVXwpDLkUwLSs0JXNrhCHPgXutjZC0piS2QQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=qineP+Sa6L3gfb0e0FiJE9tJQJfxAIM6u0Q2no4ykT5eq/HDC6sBOeJED/S6tmG4l/Fnrrk9cTX2wWra2pBzeDd/80GzT/jxU4RSMXFpbsIZzxJIXCFLY1hNRuYAvVYA2JNysdbv3LJr9qBlncqjCg7nRidFh7rS+0nesepfRGc= Received: by 10.114.182.1 with SMTP id e1mr302308waf.1176303816064; Wed, 11 Apr 2007 08:03:36 -0700 (PDT) Received: by 10.115.111.7 with HTTP; Wed, 11 Apr 2007 08:03:35 -0700 (PDT) Message-ID: Date: Wed, 11 Apr 2007 10:03:35 -0500 From: "Jeff Butler" To: user-java@ibatis.apache.org Subject: Re: Can You Map Column Indexes to Properties? In-Reply-To: <9941267.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9907_30978418.1176303815752" References: <9941267.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_9907_30978418.1176303815752 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline You can do it with a result map like this: Jeff Butler On 4/11/07, Paul Sanders wrote: > > > I have stored procedures that return Oracle REFCURSORs that I want to use > from iBATIS in Java. I've seen instructions on how to do this but I need > to > be able to map column indexes to my bean properties rather than column > names. > > The reason for this is that our dba's, in their infinite wisdom, just > renamed all the columns in the latest version of our database to "meet > standards", but the changes are not being applied to the previous versions > that the application must still support. An "easy" fix is to have > different > SQLMaps for each version but this is yucky. Better still would be to use > column indexes since the order has not changed, only the names. > > So far I haven't seen any way to do this, but I am brand new to iBATIS - > anyone got any ideas? > > Thanks > > Paul > -- > View this message in context: > http://www.nabble.com/Can-You-Map-Column-Indexes-to-Properties--tf3559865.html#a9941267 > Sent from the iBATIS - User - Java mailing list archive at Nabble.com. > > ------=_Part_9907_30978418.1176303815752 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
You can do it with a result map like this:
 
<resultMap id="fredResult" class="somepackage.Fred">
  <result property="id" columnIndex="1"/>
  <result property="name" columnIndex="2"/>
</resultMap>
 
Jeff Butler

 
On 4/11/07, Paul Sanders <tendancer@gmail.com> wrote:

I have stored procedures that return Oracle REFCURSORs that I want to use
from iBATIS in Java. I've seen instructions on how to do this but I need to
be able to map column indexes to my bean properties rather than column
names.

The reason for this is that our dba's, in their infinite wisdom, just
renamed all the columns in the latest version of our database to "meet
standards", but the changes are not being applied to the previous versions
that the application must still support. An "easy" fix is to have different
SQLMaps for each version but this is yucky. Better still would be to use
column indexes since the order has not changed, only the names.

So far I haven't seen any way to do this, but I am brand new to iBATIS -
anyone got any ideas?

Thanks

Paul
--
View this message in context: http://www.nabble.com/Can-You-Map-Column-Indexes-to-Properties--tf3559865.html#a9941267
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


------=_Part_9907_30978418.1176303815752--