【发布时间】:2014-10-12 09:40:09
【问题描述】:
我要执行以下查询:
@Query("select p from Permission p where p.userIds in ?1 ")
List<Permission> getPer(List<Long> usrsIds);
而我的实体如下:
@Entity
public class Permission extends AbstractAuditable<Permission, Long>{
private static final long serialVersionUID = -4484607117586062823L;
@ElementCollection
private List<Long> userIds;
我将查询调用如下:
monitoringPermissionRepository.getPer(usrsIds);
但是当我执行查询时,出现以下异常:
org.hsqldb.HsqlException: malformed numeric constant: .
【问题讨论】:
-
如果需要更多说明,请询问并帮助我...
-
要清楚,您需要将
Permission实体的userIds列表的每个值都包含在您提供的 long 列表中? -
你试过
@Query("select p from Permission p where p.userIds in (:usrsIds) ") List<Permission> getPer(@Param("usrsIds") List<Long> usrsIds);吗? -
@geoand 没有。仍然遇到同样的异常..
-
您是否也可以尝试我上面提到的相同查询,但在
:usrsIds周围没有括号?谢谢
标签: spring-mvc hsqldb