ibatis dao是用abator自动生成的代码,如果用到了Example实体带where条件就会出错 20
运行代码如下,我确保参数值是有的,始终不明白为什么,请大家帮帮忙谢谢List<String>idList=newArrayList<String>();idList=Ar...
运行代码如下,我确保参数值是有的,始终不明白为什么,请大家帮帮忙 谢谢
List<String> idList = new ArrayList<String>();
idList = Arrays.asList(typeString);
//设置要修改的id
AreaEntityExample example = new AreaEntityExample();
example.createCriteria().andIdIn(idList);
areaDaoGenerate.updateByExampleSelective(areaEntity, example);
javax.servlet.ServletException: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in com/wlq/entityMapping/area_SqlMap.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the area.abatorgenerated_deleteByExample.
--- 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/wlq/entityMapping/area_SqlMap.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the area.abatorgenerated_deleteByExample.
--- 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: ""
Caused by: 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: ""
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422)
就是使用AreaEntityExample 就出错
不过这是自动生成的,我把注解掉就不会有错,这个问题已经困我2天了,谢谢大家帮帮忙
我用的全都是自动生成的对象,如果不使用AreaEntityExample 对象就行 展开
List<String> idList = new ArrayList<String>();
idList = Arrays.asList(typeString);
//设置要修改的id
AreaEntityExample example = new AreaEntityExample();
example.createCriteria().andIdIn(idList);
areaDaoGenerate.updateByExampleSelective(areaEntity, example);
javax.servlet.ServletException: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in com/wlq/entityMapping/area_SqlMap.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the area.abatorgenerated_deleteByExample.
--- 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/wlq/entityMapping/area_SqlMap.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the area.abatorgenerated_deleteByExample.
--- 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: ""
Caused by: 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: ""
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422)
就是使用AreaEntityExample 就出错
不过这是自动生成的,我把注解掉就不会有错,这个问题已经困我2天了,谢谢大家帮帮忙
我用的全都是自动生成的对象,如果不使用AreaEntityExample 对象就行 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询