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