-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Passing null as stored procedure argument is broken in v2.7.0 (works in v2.6.8). #2544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Properly handle null values with like or contains. Null values are wrapped with a special handler when interacting with Hibernate. However, this becomes an issue for queries when LIKE or CONTAINS are applied. In this situation, the null needs to be condensed into an empty string and any wildcards can then be applied with expected results. Closes #2548, #2570. Supercedes: #2585. Related: #2461, #2544#
Null values are wrapped with a special handler when interacting with Hibernate. However, this becomes an issue for queries when LIKE or CONTAINS are applied. In this situation, the null needs to be condensed into an empty string and any wildcards can then be applied with expected results. Closes #2548, #2570. Supercedes: #2585. Related: #2461, #2544#
Null values are wrapped with a special handler when interacting with Hibernate. However, this becomes an issue for queries when LIKE or CONTAINS are applied. In this situation, the null needs to be condensed into an empty string and any wildcards can then be applied with expected results. Closes #2548, #2570. Supercedes: #2585. Related: #2461, #2544#
Null values are wrapped with a special handler when interacting with Hibernate. However, this becomes an issue for queries when LIKE or CONTAINS are applied. In this situation, the null needs to be condensed into an empty string and any wildcards can then be applied with expected results. Closes #2548, #2570. Supercedes: #2585. Related: #2461, #2544#
I ran your code against Spring Boot Can also confirm the issue still resides in Spring Boot |
This might explain our current issue using an |
The same problem occurs with Oracle database. Calling a procedure with a nullable parameter leads to the following error:
It works with all versions < 2.6.10. Is a correction planned or are nullable parameters no longer supported? |
is this still broken with 2.7.3? we downgraded to 2.6.8, waiting for the fix. |
It should fixed in 2.7.3, but it's not released yet. @gregturn |
we are using 2.7.3 and this is still an issue. did you mean it will be fixed in 2.7.4? |
I've just tried 2.7.4 and the issue is still there, I have updated my test project. |
Null values are wrapped with a special handler when interacting with Hibernate. However, this becomes an issue for queries when LIKE or CONTAINS are applied. In this situation, the null needs to be condensed into an empty string and any wildcards can then be applied with expected results. Closes #2548, #2570. Supercedes: #2585. Related: #2461, #2544#
v2.7.5, the issue is still there, updated my test project. |
@denis111 It should be fixed at hibernate side, I have created hibernate/hibernate-orm#5438 |
Any idea when will the issue be fixed? |
The issue is still present un v2.7.6 but it's solved in v3.0.0. I've updated my test project and created the branch |
The issue was clearly mended when Spring Data JPA moved to Hibernate 6 in Spring Boot You can see ALL the changes that happened in Spring Data JPA between |
Thank you for that analysis, but can you do one for what happened between
2.6.8 and 2.7.0? It was working and then not anymore.
…On Fri, 16 Dec 2022 at 06:18, Greg L. Turnquist ***@***.***> wrote:
The issue was clearly mended when Spring Data JPA moved to Hibernate 6 in
Spring Boot 3.0.0-M4 (Spring Data 2022.0.0-M5).
You can see ALL the changes that happened in Spring Data JPA
<3.0.0-M4...3.0.0-M5>
between 3.0.0-M4 and 3.0.0-M5, and nothing stands out except upgrading to
Hibernate 6 and properly handling nulls for LIKEs. The former will never be
backported to 2.7.x and the latter already has been in 2.7.6.
—
Reply to this email directly, view it on GitHub
<#2544 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHK5HNKSI5OAWG6ADOHJHTWNNHGBANCNFSM5WWOS37Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I have created a test case inside Spring Data JPA |
Okay, changing the reproducer's type to |
Looks like our |
Thanks @quaff for submitting the PR (#2544 (comment)). Until they accept that PR, I can conditionally de-reference the |
Hibernate supports TypedParameterValue in queries, but not stored procedures. Until hibernate/hibernate-orm#5438 is adopted, we have to dereference such parameters on our end first. Closes #2544.
Hibernate supports TypedParameterValue in queries, but not stored procedures. Until hibernate/hibernate-orm#5438 is adopted, we have to dereference such parameters on our end first. Closes #2544.
Hibernate supports TypedParameterValue in queries, but not stored procedures. Until hibernate/hibernate-orm#5438 is adopted, we have to dereference such parameters on our end first. Closes #2544.
Issue resolved. Check it out in |
Hibernate 6.1 properly handles TypeParameterValue for general parameters, but not for temporal ones. So we must dereference in those scenarios. Related: #2544, hibernate/hibernate-orm#5438
Hibernate 6.1 properly handles TypeParameterValue for general parameters, but not for temporal ones. So we must dereference in those scenarios. Related: #2544, hibernate/hibernate-orm#5438
Hibernate 6.1 properly handles TypeParameterValue for general parameters, but not for temporal ones. So we must dereference in those scenarios. Related: #2544, hibernate/hibernate-orm#5438
Merged forward to While CC @quaff |
@gregturn it looks like it didn't get to Spring Boot 2.7.7 (I've updated my test project), should we wait for 2.7.8 or it will never be included in 2.7.x branch? |
@gregturn We still have this issue. Here a stack trace:
|
Seems like there is a dependency mismatch. Using springboot-starter-data-jpa 2.7.8 it works, and it has the transient dependency to spring-data-jpa 2.7.7. |
With 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:
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
The text was updated successfully, but these errors were encountered: