spring boot jpa执行失败

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangxinxinsj/article/details/83719230

代码是这样写的
在这里插入图片描述

@Query(value = "select id from class_board_events WHERE id=?1",nativeQuery = true)
    List<ClassBoardEventEntity> getOne(int id);

返回提示

could not execute query; SQL [select id from class_board_events WHERE id=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query

错误提示

java.sql.SQLException: Column 'memeber_id' not found.

解决方案:

ClassBoardEventEntity.java里的 member_id 字段删除,因为是返回对象与对应实体里的不相符

猜你喜欢

转载自blog.csdn.net/wangxinxinsj/article/details/83719230