ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poitras Christian" <Christian.Poit...@ircm.qc.ca>
Subject RE: nested iterate over 2 different properties
Date Mon, 08 May 2006 14:47:45 GMT
Hi!
 
If you want a workaround for your problem and you need it now, can recompile the code from
source. The source code for iBatis 2.1.7 is included in the zip file you downloaded from iBatis
web site.
You will need to modify the files in iBatis by downloading the files in issue IBATIS-281.
The simpliest way is to overwrite the files with the source classes found in the issue. Once
this is done, you will compile classes and you can compress the classes in a usable jar file.
 
The problem should be resolved for the next release of iBatis (I hope so) since Jeff Butler
is working on the problem.
 
If you have any questions for the workaround, please send me an email.
 
Christian Poitras
Christian.Poitras@ircm.qc.ca

________________________________

From: ggb275@tid.es [mailto:ggb275@tid.es] 
Sent: Monday, 08 May 2006 05:33
To: ibatis-user-java@incubator.apache.org
Subject: nested iterate over 2 different properties


Hello, 

I am using ibatis 2.1.7, and I have the following sql statement:

<statement ...>
    <iterate property="tabla" conjunction="UNION">
    SELECT       
        <iterate property="agrupaciones" conjunction=",">
            TABLA.$agrupaciones[]$
        </iterate>
    FROM $tabla[]$ TABLA
    WHERE
        TABLA.A IN ('A','B','C','D','W','G')
    </iterate>
</statement>

where:
    $tabla[]$ = { "PENDIENTES", "ANULADAS" }
    $agrupaciones[]$ = { "AREA" }

but the generated sentence is:

    SELECT
        TABLA.AREA
    FROM PENDIENTES TABLA 
    WHERE
        TABLA.A IN ('A','B','C','D','W','G')    
    UNION
    SELECT
    FROM ANULADAS TABLA WHERE
        TABLA.A IN ('A','B','C','D','W','G')

instead of:

    SELECT
        TABLA.AREA
    FROM PENDIENTES TABLA
    WHERE
        TABLA.A IN ('A','B','C','D','W','G')     
    UNION    
    SELECT
        TABLA.AREA
    FROM ANULADAS TABLA 
    WHERE
        TABLA.A IN ('A','B','C','D','W','G')    

It seems not to be using the correct index for the property "agrupaciones" in the second iteration
of the property "tabla"... I think this is a bug (maybe related to http://issues.apache.org/jira/browse/IBATIS-281)
Is there any idea or workaround to solve it?

Thank you very much,
Guido GarcĂ­a Bernardo


Mime
View raw message