小编ruu*_*yin的帖子

意外的 AST 节点:Spring Data Jpa 中的 {vector}

我想从INunit的数据库中检索数据。 ("value1", "value2")

以下是请求正文示例。

{
    "researchers":null,
    "unit": ["value1","value2"],
    "agency":null,
    "date": null,
    "status": null,
    "budget": null
}
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用给定的参数请求时,我得到了org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: {vector}. 但是当我像这样传递单个值时unitunit:["value1"] ,效果很好。我认为我的存储库有问题,但我不知道问题出在哪里。

以下是我的存储库:

  @Query("select r from Research r " +
            "left join r.fundingAgencies fundingAgencies " +
            "left join r.researchers researchers " +
            "where (:budgetStart is null or :budgetEnd is null or  r.budget between :budgetStart and :budgetEnd )" +
            "and (:startDate is null or r.startDate >= :startDate) " +
            "and (:endDate is null …
Run Code Online (Sandbox Code Playgroud)

java spring hibernate hql spring-data-jpa

3
推荐指数
1
解决办法
3552
查看次数

标签 统计

hibernate ×1

hql ×1

java ×1

spring ×1

spring-data-jpa ×1