Incompatible types. Required List but 'query' was inferred to T: no instance(s) of type variable(s) exist so that Teacher conforms to List


问题:Incompatible types. Required List<Teacher> but 'query' was inferred to T: no instance(s) of type variable(s) exist so that Teacher conforms to List<Teacher>

不兼容的类型。必需的List<Teacher>但是'query'被推断为T:不存在类型变量的实例,因此Teacher符合List<Teacher>

 

 解决方法:

List<Teacher> teachers= (List<Teacher>) 
queryRunner.query(DbUtils.getConnection(),
"select * from teacher;",new BeanHandler<Teacher>(Teacher.class));

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM