ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave.De...@Equifax.com
Subject Re: Result Map - duplicate columns
Date Tue, 22 Jan 2008 17:05:40 GMT
Try this:

Select DISTINCT
         A.Key as java1,
         B.Key as java2,
         C.Key as java3
From
          A,B,C


<result property="java1" column="java1"/>
<result property="java2" column="java2"/>
 <result property="java3" column="java3"/>

so that the column aliases match up with the column values.


Dave

We must begin not just to act, but to think, for there is no better slave
than the one who believes his slavery to be freedom, and we are in
no greater peril than when we cannot see the chains on our minds
because there are yet no chains on our feet.
-- Michael Reid




                                                                           
             pramodreddy.kampa                                             
             lli@gsa.gov                                                   
                                                                        To 
             01/22/2008 11:59          user-java@ibatis.apache.org         
             AM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         Result Map - duplicate columns      
             user-java@ibatis.                                             
                apache.org                                                 
                                                                           
                                                                           
                                                                           
                                                                           





Hi there,

       I  currently use the query (using alias) as:

Select DISTINCT
         A.Key as java1,
         B.Key as java2,
         C.Key as java3
From
          A,B,C

But now for performance issues  when i tried to use result map like this:


<result property="java1" column="Key"/>
<result property="java2" column="Key"/>
 <result property="java3" column="Key"/>


Select DISTINCT
         A.Key
         B.Key
         C.Key
From
          A,B,C


Doesnot work, there are no errors but i could see the same values returning
in all the columns.

In another attempt I have tried like this:

               <result property="java1" column="Key" columnIndex ="0"/>
            <result property="java2" column="Key" columnIndex ="1"/>
                <result property="java3" column="Key" columnIndex ="2"/>


But doesnot work .. the result is same.

Can any help me fixing this problem...??


Regards,
Pramodreddy Kampalli




Mime
View raw message