【问题标题】:Getting malformed numeric constant:获取格式错误的数字常量:
【发布时间】: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&lt;Permission&gt; getPer(@Param("usrsIds") List&lt;Long&gt; usrsIds);吗?
  • @geoand 没有。仍然遇到同样的异常..
  • 您是否也可以尝试我上面提到的相同查询,但在:usrsIds 周围没有括号?谢谢

标签: spring-mvc hsqldb


【解决方案1】:

这可能是因为您正在获取另一个列表中的列表。

【讨论】:

    猜你喜欢
    • 2015-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-01
    • 2018-12-13
    • 1970-01-01
    相关资源
    最近更新 更多