{{PostgreSQLStoredProcedureTest.testProcedureWithJDBCByName}} {{PostgreSQLFunctionProcedureTest.testFunctionWithJDBCByName}}
fail with similar error using named parameters:
{noformat} java.lang.AssertionError: expected:<class java.sql.SQLFeatureNotSupportedException> but was:<class com.edb.util.PSQLException>{noformat}
{noformat}com.edb.util.PSQLException: A CallableStatement has a named parameter undefined in the calling statement. Parameter: phoneCount at com.edb.jdbc.PgCallableStatement.getNamedParameterIndex(PgCallableStatement.java:1152) ~[edb-jdbc-42.5.0.1.jar:42.5.0.1-SNAPSHOT] at com.edb.jdbc.PgCallableStatement.registerOutParameter(PgCallableStatement.java:831) ~[edb-jdbc-42.5.0.1.jar:42.5.0.1-SNAPSHOT] at org.hibernate.orm.test.procedure.PostgreSQLStoredProcedureTest.lambda$testProcedureWithJDBCByName$5(PostgreSQLStoredProcedureTest.java:221) ~[test/:?] at org.hibernate.jdbc.WorkExecutor.executeReturningWork(WorkExecutor.java:56) ~[main/:?] at org.hibernate.internal.AbstractSharedSessionContract.lambda$doReturningWork$6(AbstractSharedSessionContract.java:973) ~[main/:?] at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:290) ~[main/:?] at org.hibernate.internal.AbstractSharedSessionContract.doWork(AbstractSharedSessionContract.java:977) ~[main/:?] at org.hibernate.internal.AbstractSharedSessionContract.doReturningWork(AbstractSharedSessionContract.java:973) ~[main/:?] at org.hibernate.orm.test.procedure.PostgreSQLStoredProcedureTest.lambda$testProcedureWithJDBCByName$6(PostgreSQLStoredProcedureTest.java:217) ~[test/:?] at org.hibernate.testing.transaction.TransactionUtil.doInJPA(TransactionUtil.java:258) [hibernate-testing-6.2.0-SNAPSHOT.jar:6.2.0-SNAPSHOT] at org.hibernate.testing.transaction.TransactionUtil.doInJPA(TransactionUtil.java:299) [hibernate-testing-6.2.0-SNAPSHOT.jar:6.2.0-SNAPSHOT] at org.hibernate.orm.test.procedure.PostgreSQLStoredProcedureTest.testProcedureWithJDBCByName(PostgreSQLStoredProcedureTest.java:214) [test/:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) [junit-4.13.2.jar:4.13.2] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.13.2.jar:4.13.2] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) [junit-4.13.2.jar:4.13.2] at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) [hibernate-testing-6.2.0-SNAPSHOT.jar:6.2.0-SNAPSHOT] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.13.2.jar:4.13.2] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.13.2.jar:4.13.2] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-4.13.2.jar:4.13.2] at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299) [junit-4.13.2.jar:4.13.2] at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293) [junit-4.13.2.jar:4.13.2] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.lang.Thread.run(Thread.java:829) [?:?]{noformat}
while {{PostgreSQLFunctionProcedureTest}} could by be fixed by referencing parameters in query {{sp_count_phones(?,?)}} → {{call sp_count_phones(phoneCount=>?,personId=>?)}}
I didn’t find a similar syntax for {{PostgreSQLFunctionProcedureTest}}.
|
|