ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Debasish Dutta Roy" <debasish.dutta...@gmail.com>
Subject 2 Lists in query statement
Date Thu, 15 Jun 2006 21:26:50 GMT
hi all
I need to add 2 lists into the query. i.e. I have a select with 2 IN clause.
Used an object with 2 lists. Passed that to the query.

    <select id="getPSPIds" resultClass="java.util.ArrayList"
cacheModel="profile-cache" parameterClass="
com.mycriteria.ProfileProtocolCriteria">
        select distinct psp.profile_study_protocol_id
        from profile_study_protocol psp, profile_protocol_item ppi
        where
            psp.profile_study_protocol_id = ppi.profile_study_protocol_id
            <dynamic prepend="AND">
                <iterate open="psp.profile_id IN(" close=")"
conjunction=",">
                    #[profileIdList]#
                </iterate>
            </dynamic>
            and psp.status_id is null
            <dynamic prepend="AND">
                <iterate open="ppi.profile_protocol_item_id IN(" close=")"
conjunction=",">
                    #[ppiIdList]#
                </iterate>
            </dynamic>
            and ppi.is_target is not null
    </select>

ProfileCriteria has 2 member variables with the names in the dynamic clause.

Getting the error:

-- Cause: com.ibatis.sqlmap.client.SqlMapException: ParameterObject or
property was not a Collection, Array or Iterator.

Mime
View raw message