--配置文件内容
<typeAlias alias="newsDO" type="com.wasu.eis.dataobject.firstpage.NewsDO" />
<select id="queryNews" parameterClass="newsDO" resultMap="RM_NewsDO">
select * from front_news
where newsid in
<iterate property="objectIds" conjunction="," open="(" close=")">
#value[]#
</iterate>
</select>
--实力类
public class NewsDO {
private Long newsId;
private Long objectIds;
.....set/get
}
---测试方法
public void test(){
NewsDO news=new NewsDO();
news.getObjectIds().add(0l);
this.newsService.ueryNews(news);
}
-----报错
信息: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in com/wasu/eis/sqlmap/news-sqlmap-mapping.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the News.addNews.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException: For input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/wasu/eis/sqlmap/news-sqlmap-mapping.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the News.addNews.
--- Check the parameter map.
兄弟们看为什么 ibatis配置文件里parameterClass="newsDO" 换成java.util.List 就行了,
为什么对像里面的List 就是报错。
我看网上也是这样啊 怎么行啊。
请高手指定下 急急急!!!在线等