ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Campbell" <rrc...@gmail.com>
Subject <iterate> used to work, now fails
Date Thu, 29 Jun 2006 08:45:03 GMT
Here is my code:

    <select id="findAwards" resultMap="awardResult" parameterClass="
java.util.List">
        select * from award2 where
        <iterate conjunction="AND">
            UPPER(award_name) LIKE #value[]#
        </iterate>
        ORDER BY award_id
    </select>

This used to work perfectly. Then it suddenly stopped working, and I'm
unable to track down why. Please give me suggestions on how to troubleshoot
the problem. I have log4j debug turned on, and here is what is produced:

2006-06-29 10:37:05,046 [http-8070-Processor23] DEBUG
java.sql.PreparedStatement(23) - {pstm-100010} PreparedStatement:
select * from award2 where               UPPER(award_name) LIKE
?                   ORDER BY award_id
2006-06-29 10:37:05,046 [http-8070-Processor23] DEBUG
java.sql.PreparedStatement(23) - {pstm-100010} Parameters: ['%AWA%']
2006-06-29 10:37:05,046 [http-8070-Processor23] DEBUG
java.sql.PreparedStatement(23) - {pstm-100010} Types: [java.lang.String]
2006-06-29 10:37:05,077 [http-8070-Processor23] DEBUG java.sql.ResultSet(23)
- {rset-100011} ResultSet

As you can see, it generates the SQL fine, but returns an empty ResultSet.
The SQL generation also works fine if I pass in a list of more then one
elements. If I take out the iterate, and I simple have:

    <select id="findAwards" resultMap="awardResult" parameterClass="
java.util.List">
        select * from award2 where

            UPPER(award_name) LIKE '%AWA%'

        ORDER BY award_id
    </select>

It suddenly works again. Thank you!

Mime
View raw message