1.实体bean:ProductType
2.字段id,name
ProductType.xml 中定义一个查询,如下:
select * from ProductType where 1=1
and name like #{productType.name}
查询:
Map map=new HashMap();
ProductType a=new ProductType();
a.setName("XXXXX");//////////////////////////////注意这里
map.put("productType", a);
map.put("pageSize", 10);
List p= session.selectList("ProductType.getScrollPage", map);
问题:
如果a.setName赋值了,查询没问题
可是如果a没有setName,系统就报错:
Cause: org.apache.ibatis.executor.ExecutorException: There was no TypeHandler found for parameter productType of statement ProductType.getScrollPage
而且如果查询是select * from ProductType ,没有其他任何条件,报同样的错误,只有传name才不报错。搞笑了
这里的人太水了。。。。。