org.springframework.dao.InvalidDataAccessResourceUsageException


org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet

 

往上看报错

 

 发现是数据库表中字段名写错了。。。

因为使用了JpaRepository,有一定的映射规则,对于表对应的实体类的成员变量有严格的限制。

例如,数据库列名为student_id、student_name,则Java的Student类的成员变量要命名为studentId和studentName。即把下划线改为驼峰写法。


免责声明!

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



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