|
As I mentioned, I'm using Spring Data JPA, so my code is literally boils down to this repository interface and test method:
public interface MyDomainRepository extends JpaRepository<MyDomain, Long> {
@Procedure("STRING_IN")
String stringIn(final String inValue);
}
Where JpaRepository is in org.springframework.data.jpa.repository.support and Procedure is in org.springframework.data.jpa.repository.query.
public class MyDomainRepositoryTest {
@Autowired
private MyDomainRepository myDomainRepository;
@Test
public void testStringIn() throws Exception {
this.myDomainRepository.stringIn('test');
}
}
This results in Spring Data's JpaQueryExecution$ProcedureExecution.doExecute(AbstractJpaQuery, Object[]) method calling Hibernates StoredProcedureQueryImpl.execute() method.
I realize that is probably not very helpful for you, but I think it is a fair to say that I am using Hibernates JPA 2.1 support for stored procedures and that is not working for H2. After looking at your H2 forum posts and stepping through some of the H2 JdbcPreparedStatement calls, I understand your frustration with the H2 driver. It certainly seems like they didn't play by the rules set out in PreparedStatement.
|