I have a simple stored procedure I\'m using to test out Spring Data JPA Stored Procedure feature.
create or replace procedure plus1inout (arg in int,res1 out int
You can specify to return one of the multiple out params with the outputParameterName
param in the @Procedure
annotation like this:
@Repository
public interface AdjudConverDateSPRepository extends JpaRepository {
@Procedure(name = "plus1", outputParameterName = "res2")
Integer plus1(@Param("arg") Integer arg);
}
UPDATE 2019-06-24:
Multiple out parameters is now supported in Spring Data JPA 2.2-RC1 https://spring.io/blog/2019/06/17/spring-data-moore-rc1-and-lovelace-sr9-released
https://jira.spring.io/browse/DATAJPA-707
The interface method just needs to have a Map return type so each out param can be accessed by key name:
@Repository
public interface AdjudConverDateSPRepository extends JpaRepository {
@Procedure(name = "plus1")
Map plus1(@Param("arg") Integer arg);
}