从Hibernate调用postgreSQL存储过程

时间:2015-09-03 09:15:09

标签: java hibernate postgresql jdbc

当我尝试从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)

请帮我解决此问题

0 个答案:

没有答案