I had to do this a while back and just used JdbcTemplate, I was using hibernate already in the application but trying to map the stored procedure with the NamedNativeQuery annotation turned out to be a major PITA. Found using JdbcTemplate was straightforward and easier to maintain.
Example of calling a function that takes 2 NUMBER parameters and returns a NUMBER
Code:
final Object result = jdbcTemplate.execute(
"{ ? = call myPackage.someFunction(?,?)}", new CallableStatementCallback() {
public Object doInCallableStatement(final CallableStatement cs) throws SQLException {
cs.registerOutParameter (1, Types.INTEGER);
cs.setLong(2, someParam);
cs.setLong(3, anotherParam);
cs.execute();
return cs.getInt(1);
}
});