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。即把下划線改為駝峰寫法。