81,092
社区成员
发帖
与我相关
我的任务
分享
{
"cause": null,
"message": "PersistentEntity must not be null!"
}
@RepositoryRestResource(path = "vote")
public interface ArticleVoteRepository extends JpaRepository<ArticleVote, Integer> {
@Query(nativeQuery = true, value = "select v.id,v.count,v.title, case when exists(select * from vote_join_user where vu.user_id=:user and vu.vote_id=v.id) then 'true' else 'false' end as flag from article_vote v left join vote_join_user vu on v.id = vu.vote_id and vu.user_id=:user")
public List<?> findVoteList(@Param("user") Integer user);
}
{
"timestamp": 1513955876179,
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.dao.InvalidDataAccessResourceUsageException",
"message": "could not execute query; SQL [select v.id,v.count,v.title, case when exists(select * from vote_join_user where vu.user_id=? and vu.vote_id=v.id) then 'true' else 'false' end as flag from article_vote v left join vote_join_user vu on v.id = vu.vote_id and vu.user_id=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query",
"path": "/api/vote/search/findVoteList"
}