码迷,mamicode.com
首页 > 其他好文 > 详细

关于泛型的教训

时间:2017-03-23 21:44:00      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:tab   ase   util   system   mybatis   database   pac   where   let   

sql查询结果我用List接收就一直报异常:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: <|### Error querying database.  Cause: java.lang.UnsupportedOperationException<|### The error may exist in ***Dao.java (best guess)<|### The error may involve ***Dao.**-Inline<|### The error occurred while setting parameters<|### SQL: *** where **=?<|### Cause: java.lang.UnsupportedOperationException

改成List<Map<String,Integer>>接收就正常了,再改成List还是异常,再泛型还是正常。

结论:泛型并不是可有可无的,能泛型就泛型,泛型能用子类不用父类!

关于泛型的教训

标签:tab   ase   util   system   mybatis   database   pac   where   let   

原文地址:http://www.cnblogs.com/yanan7890/p/6607172.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!