ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: How to resolve same column/property name when reusing resultMap continued
Date Tue, 13 Jan 2009 16:15:05 GMT
I know of these options for dealing with duplicate column names:

1. Alias the columns so the names are unique.  Note that this is not
an iBATIS problem - this is they way JDBC works.  This is the best
solution IMHO.
2. Don't alias the column names and use column indexes in your result
mappings.  This works, but is hard to maintain and you have to be very
careful that the indexes match up and stay the same.
3. If you are using MySQL, then you can append the table name to the
column name in the result mapping to deal with duplicate column names.
 As far as I know, MySQL is the only database that supports this.

Jeff Butler


2009/1/13 Frantisek Rezac <Frantisek.Rezac@profinit.eu>:
>
> Hi,
> I'm writing just to verify that there is no other way to solve problem from
> this thread:
> http://www.mail-archive.com/user-java@ibatis.apache.org/msg07715.html
>
> solution proposed here is not working when there is more than one foreign
> key to the same second table - I simply have to copypaste the result map for
> the second foreign key. Am I right?
> František Řezáč
> Consultant
>
> Profinit, s.r.o. | Člen skupiny NFH
> Tychonova 2 | 160 00 Praha 6
> Mobil: +420 725 817 361 | Tel: +420 224 316 016
> Email: frantisek.rezac@profinit.eu
> Více o nás: www.profinit.eu
>
>
>
Mime
View raw message