您已经编写了
native查询,因此,尝试将nativeQuery传递为true
@Query("select id, x, y from test where x = :x", nativeQuery = true)或者你可以写
HQL查询
@Query("SELECt t.id, t.x, t.y FROM Test t where t.x = :x")请参考此链接以获取更多信息。https://docs.spring.io/spring-
data/jpa/docs/current/reference/html/#jpa.query-methods.at-
query



