使用某个子句查询时,参数值与预期类型不匹配

时间:2016-09-07 12:21:37

标签: spring hibernate jpa spring-data spring-data-jpa

@Query("select w from GroupChatHeartBeat w where w.gender=?1 AND w.Id in (?2) order by heartBeatTime DESC limit 1")
public Long findId(String gender,List<Long> participants);

我想根据性别检索参与者列表中可用的参与者的ID。但我得到的是例外情况。

SEVERE: Servlet.service() for servlet [rest] in context with path [/app] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value element [4027291] did not match expected type [java.lang.Long]; nested exception is java.lang.IllegalArgumentException: Parameter value element [4027291] did not match expected type [java.lang.Long]] with root cause
java.lang.IllegalArgumentException: Parameter value element [4027291] did not match expected type [java.lang.Long]

0 个答案:

没有答案