一直报错然而数据库是和实体类完全匹配的
使用原生的findById就没问题
接口代码如下:
@Query(value = "SELECT id " +
" FROM b_expenses where id = ?1 ",
nativeQuery = true
)
Expenses select(String projectId);
请配置好驼峰,应该是javabean与字段名称不一致的原因。
@Query(value = "SELECT id FROM b_expenses where id = ?1",nativeQuery = true)
Expenses select(String id);
试试这种。没有效果的话,点击我头像私信给你远程看下。