iBatis cannot return List or List ??


<param-map id="/le/queryForDocIdListParams">
<property name="esubMainId" sqlType="BIGINT" validate="false" />
<property name="esubExamId" sqlType="BIGINT" validate="false" />
</param-map>
<result-map id="/le/queryForDocIdListResults" class="java.lang.Long">
</result-map>
<map-sql id="/le/queryForDocIdList" type="query"
param-map="/le/queryForDocIdListParams"
result-map="/le/queryForDocIdListResults">
<![CDATA[
SELECT DOC_ID
FROM LIC_LE_ESUB_SUPP_DOC
WHERE 1=1
<isNotEmpty property="esubMainId">
AND LE_ESUB_MAIN_ID = ##esubMainId##
</isNotEmpty>
<isNotEmpty property="esubExamId">
AND LE_ESUB_EXAM_ID = ##esubExamId##
</isNotEmpty>
AND DELETE_IND = 'F'
]]>
</map-sql>


Log:
java.lang.InstantiationException: java.lang.Long
at java.lang.Class.newInstance0(Class.java:335)
at java.lang.Class.newInstance(Class.java:303)

This caused by, there is no default constructor in java.lang.Long class, cannot initialize a Long with 'new Long()'.


Although java.lang.String has a default constructor, but there is no setter method to set result, so finally an arraylist contains several
empty string (""). Maybe I used it incorrectly.
發佈了31 篇原創文章 · 獲贊 0 · 訪問量 1157
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章