ibatis 自动生成代码工具abator 生成的 实体example类 不知道怎么使用使用
publicList<Users>getbyCondtion(Usersuser){List<Users>users=null;UsersExampleexample=n...
public List<Users> getbyCondtion(Users user){
List<Users> users=null;
UsersExample example=new UsersExample();
Criteria cri=example.createCriteria();
cri.andAgeBetween(23, 30);
List li=example.getOredCriteria();
li.add("age");
example.or(cri);
example.setOrderByClause("age asc");
try {
users=userDao.selectByExample(example);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return users;
}
这是我的方法
下面是报错信息:请高手指点
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/app/entity/users_SqlMap.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the users.abatorgenerated_selectByExample.
--- 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: "" 展开
List<Users> users=null;
UsersExample example=new UsersExample();
Criteria cri=example.createCriteria();
cri.andAgeBetween(23, 30);
List li=example.getOredCriteria();
li.add("age");
example.or(cri);
example.setOrderByClause("age asc");
try {
users=userDao.selectByExample(example);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return users;
}
这是我的方法
下面是报错信息:请高手指点
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/app/entity/users_SqlMap.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the users.abatorgenerated_selectByExample.
--- 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: "" 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询