休止状態を使用してネイティブ/生のmysqlクエリを実行したいのですが、これがあります:
sessionFactory.getCurrentSession().createSQLQuery(
"update table1 set someCounter = someCounter + 1 where id = ?")
.setParameter(1, someId)
.executeUpdate();
エラーが発生します:
threw exception [Request processing failed; nested exception is
org.hibernate.QueryParameterException: Position beyond number of declared ordinal
parameters. Remember that ordinal parameters are 1-based! Position: 2]
with root cause
org.hibernate.QueryParameterException: Position beyond number of declared ordinal
parameters. Remember that ordinal parameters are 1-based! Position: 2
ここで何が問題なのですか?