的Java我使用ibatis的的Java ibatis的迭代名單
使用條款要在子句中迭代,每個人談論下面的解決方案,但是當我嘗試它給了我下面的錯誤。
**Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named '[]' in class 'java.util.List'**
List entityIds = new ArrayList(2);
entityIds.add(42167777);
entityIds.add(43178455);
(List<EventCategory>)sqlMapClient.queryForList("getEventCategoryByEntityIds", entityIds);
<select id="getEventCategoryByEntityIds" parameterClass="java.util.List" resultMap="eventCategoryDetails">
<![CDATA[
SELECT E.EVENTCATEGORYID, ECAT.Name EVENTCATEGORYNAME, E.EVENTSUBCATEGORYID , ESUBCAT.Name EVENTSUBCATEGORYNAME FROM
Event E (nolock)
JOIN EVENTCATEGORY ECAT (nolock) ON E.EventCategoryId=ECAT.EventCategoryId JOIN EVENTCATEGORY ESUBCAT ON E.EVENTSUBCATEGORYID=ESUBCAT.EventCategoryId
<dynamic prepend="where ENTITYID in ">
<iterate open="(" close=")" conjunction=",">
#[]#
</iterate>
</dynamic>
]]>
</select>
我生病了,試過嘗試這種解決方案,但沒有工作。任何幫助讚賞..
我相信CDATA標籤會阻止ibatis做動態sql嗎? –