Olá nosso amigo, foram feitas as alterações, porém continua com erro:
ERROR: public.spesp01() is a procedure
Dica: To call a procedure, use CALL.
NO Repository
----------------
@Procedure("public.spesp01")
void spesp01();
No Service
----------------
public void executaProcedure(){
especialidadeRepository.spesp01();
}
No Controller
----------------
@PostMapping("/exeProcedure")
public void exeProcedure(){
especialidadeService.executaProcedure();
}
erro
----------------
...
2022-05-09 02:25:42.396 INFO 10492 --- [ restartedMain] c.c.s.SyscoopmedrnapiApplication : Started SyscoopmedrnapiApplication in 5.252 seconds (JVM running for 5.67)
2022-05-09 02:25:47.966 INFO 10492 --- [nio-8080-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-05-09 02:25:47.966 INFO 10492 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2022-05-09 02:25:47.967 INFO 10492 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms
Hibernate: {call public.spesp01()}
2022-05-09 02:25:48.043 WARN 10492 --- [nio-8080-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 42809
2022-05-09 02:25:48.046 ERROR 10492 --- [nio-8080-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper :
ERROR: public.spesp01() is a procedure
Dica: To call a procedure, use CALL.
Posição: 15
2022-05-09 02:25:48.062 ERROR 10492 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error calling CallableStatement.getMoreResults; SQL [public.spesp01]; nested exception is org.hibernate.exception.SQLGrammarException: Error calling CallableStatement.getMoreResults] with root cause
org.postgresql.util.PSQLException: ERROR: public.spesp01() is a procedure
Dica: To call a procedure, use CALL.
Posição: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2552) ~[postgresql-42.2.23.jar:42.2.23]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2284) ~[postgresql-42.2.23.jar:42.2.23]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:322) ~[postgresql-42.2.23.jar:42.2.23]
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481) ~[postgresql-42.2.23.jar:42.2.23]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401) ~[postgresql-42.2.23.jar:42.2.23]
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164) ~[postgresql-42.2.23.jar:42.2.23]
at org.postgresql.jdbc.PgCallableStatement.executeWithFlags(PgCallableStatement.java:83) ~[postgresql-42.2.23.jar:42.2.23]
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:153) ~[postgresql-42.2.23.jar:42.2.23]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariProxyCallableStatement.execute(HikariProxyCallableStatement.java) ~[HikariCP-4.0.3.jar:na]
at org.hibernate.result.internal.OutputsImpl.<init>(OutputsImpl.java:56) ~[hibernate-core-5.4.32.Final.jar:5.4.32.Final]
at org.hibernat
...