Passing null as stored procedure argument is broken in v2.7.0 (works in v2.6.8).
See original GitHub issueWith spring.jpa.properties.hibernate.proc.param_null_passing=true we can pass null as stored procedure as parameter without any problem with Spring Boot 2.6.8 but upgrading to v2.7.0 throws exception with the same Hibernate version. I’ve tried only with PostgreSQL and UUID as procedure parameter but I suppose it could be for any type of DB and parameters. The exception is:
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Bind value [org.hibernate.jpa.TypedParameterValue@5b1420f9] was not of specified type [class java.util.UUID; nested exception is java.lang.IllegalArgumentException: Bind value [org.hibernate.jpa.TypedParameterValue@5b1420f9] was not of specified type [class java.util.UUID
Example:
public interface TestModelRepository extends JpaRepository<TestModel, Long> {
@Procedure("countByUuid")
void countUuid(UUID one);
}
then just call testModelRepository.countUuid(null).
I’ve prepared a sample project to reproduce the problem, just change Spring Boot version to 2.6.8 and it works fine: https://github.com/denis111/spring-data-jpa270test
Issue Analytics
- State:
- Created a year ago
- Reactions:8
- Comments:11 (3 by maintainers)
Top Related StackOverflow Question
It should fixed in 2.7.3, but it’s not released yet. @gregturn
@denis111 It should be fixed at hibernate side, I have created https://github.com/hibernate/hibernate-orm/pull/5438