emacarron / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Iterator problem #127

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using? 2.3.3

Please describe the problem.  Unit tests are best!

When running the following code:
  <iterate property="criteriaSet[].entries" conjunction="OR">
            (
            F.TRIAL_UID = #criteriaSet[].entries[].trial.id#

            <isNotEmpty property="criteriaSet[].entries[].gnaAndGeneration">
                AND (
                <iterate property="criteriaSet[].entries[].gnaAndGeneration" conjunction="OR">
                    (
                    TRIM(PD.GNA_CROSS_NUMBER) = #criteriaSet[].entries[].gnaAndGeneration[].crossNumber#

                    <isNotEmpty property="criteriaSet[].entries[].gnaAndGeneration[].generation">
                        AND
                        PD.GENERATION_UID = #criteriaSet[].entries[].gnaAndGeneration[].generation.id#
                    </isNotEmpty>

                    )
                </iterate>
                )
            </isNotEmpty>
            )
        </iterate>

the following error appears:
 Cause java.lang.NumberFormatException: For input string: ""

and when inserting zero as an index in the gnaAndGeneration to be 
"<isNotEmpty 
property="criteriaSet[].entries[].gnaAndGeneration[0].generation">", the error 
disappear

What is the expected output? What do you see instead?

Please provide any additional information below.

Original issue reported on code.google.com by eman_a...@hotmail.com on 4 Oct 2010 at 10:03