ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris O'Connell" <oconn...@gorillachicago.com>
Subject position while iterating
Date Wed, 11 Feb 2009 19:33:24 GMT
Is there any way to find my position while iterating through a collection in
the sqlMap file.  For example, I want to do something like this:

<iterate property="attributes" >

                ,(

                    SELECT TEMP_PA.PRODUCT_ID
                    FROM PRODUCT_ATTRIBUTES TEMP_PA,
                        ATTRIBUTES TEMP_A
                    WHERE (
                        TEMP_A.ATTRIBUTE_ID = TEMP_PA.ATTRIBUTE_ID
                        AND TEMP_A.NAME = #attributes[].name#
                        <iterate property="attributes[].values" prepend="
AND ( " close=" ) " conjunction=" OR " >
                            <isNotEmpty
property="attributes[].values[].value">
                                
                                    TEMP_PA.VALUE =
#attributes[].values[].value#
                                
                            </isNotEmpty>
                        </iterate>
                    )
                ) TEMP$attributes[].name$_{POSITION_IN_ITERATION}
                </iterate>

I may have multiple attributes with the same name, so I need something that
will allow me to uniquely name this alias.  Anyone have any ideas?

Thanks,
Chris



Mime
View raw message