以下Pageable Query将PageRequest类作为第二个参数。这似乎是例外的原因。
Caused by: org.h2.jdbc.JdbcSQLException: Parameter "#2" is not set; SQL statement: ... order by message0_.id desc limit ? [90012-187]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.expression.Parameter.checkSet(Parameter.java:80)
at org.h2.command.Prepared.checkParameters(Prepared.java:164)
at org.h2.command.CommandContainer.query(CommandContainer.java:89)
at org.h2.command.Command.executeQuery(Command.java:197)
at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:108)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:82)
... 98 more
更新:尝试删除第二个参数只是为了查看它是否有效,但它是相同的错误,除了它现在指向“#1”而不是“#2”See here
答案 0 :(得分:0)
尝试使用列表<>而不是设置<>。将其更改为。同时将方法名称更改为findBySymbolsIn()
@Query(value="select msg from Message msg left join msg.tickers ticker where ticker.symbol IN (:symbols)")
Page<Tweet> findBySymbolsIn(@Param("symbols") List<Symbol> symbols, Pageable pageable);
答案 1 :(得分:0)
更改参数以取代ID而不是符号类,这是有效的。
555 "DEF" "-0.00100" "-0.00100" "-0.00100" 0.0000 1 1
444 "EFG" "-0.00100" "-0.00100" "-0.00100" 0.0000 1 1