当我尝试从Java
- Hibernate
调用存储过程时。我收到了以下错误。
org.hibernate.QueryException: Not all named parameters have been set:
和我的代码
Query query = session.createSQLQuery("select commsrules.evalcommsrules(?::text,?::commsrules.t_commstype)");
query.setString(0, in_query);
query.setString(1, "TRIG");
result = query.list();
我得到了以下异常
org.hibernate.QueryException: Not all named parameters have been set: [:text, :commsrules.t_commstype] [select commsrules.evalcommsrules(?::text,?::commsrules.t_commstype)]
at org.hibernate.internal.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:390)
at org.hibernate.internal.SQLQueryImpl.verifyParameters(SQLQueryImpl.java:179)
at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:118)
请帮我解决此问题