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 <[EMAIL PROTECTED]> 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.


Reply via email to