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还是异常,再泛型还是正常。
结论:泛型并不是可有可无的,能泛型就泛型,泛型能用子类不用父类!
时间: 2024-10-13 11:33:32