如何正确创建jpql请求?

nhjlsmyf  于 2021-07-05  发布在  Java
关注(0)|答案(1)|浏览(240)

我有存储库方法:

@Query(value = "select t from Transaction t " +
        "where t.bankAccountId in (:bankAccountIds) " +
        "and t.tradeTime is not null " +
        "and t.ccy is not null " +
        "and t.net is not null " +
        "and t.tradeTime >= :startDate and t.tradeTime <= :endDate " +
        "and t.status = :status")
List<Transaction> findAllByBankAccountIdInAndTradeTimeBetween(@Param("bankAccountIds") Iterable<UUID> bankAccountIds,
                                                              @Param("status") TransactionStatus status,
                                                              @Param("startDate") LocalDateTime startDate,
                                                              @Param("endDate") LocalDateTime endDate);

但当我尝试使用这段代码时,我有一个例外:
导致原因:org.postgresql.util.psqlexception:error:语法错误位于或接近“)”
如何修复?

i7uaboj4

i7uaboj41#

我想你不需要括号(:bankAccountId)

相关问题