Parameter binding of converted TemporalJavaType fails
Description
Activity
Christian Beikov October 17, 2022 at 5:37 PM
It’s fine, just keep in mind not to do that in the future. I’ll look into this and thanks for the issue report as well as the test case. Join us on Zulip if you want to bring something to our attention
Hannes Rosenögger October 17, 2022 at 5:31 PM
Sorry
I’ve unassinged you. I didn’t figure out how to mention you correctly in the comments so I resorted to this.
Christian Beikov October 17, 2022 at 5:28 PM
You can certainly bring this to my attention, but please don’t just assign issues to people.
Hannes Rosenögger October 17, 2022 at 5:25 PMEdited
@Christian Beikov looks like the commit that introduced this regression was authored by you. Can you take a look if you have some time?
I assigned the issue to you for now, I hope that was ok.
Hannes Rosenögger October 17, 2022 at 5:17 PM
I’ve spent some more time debugging this and found the commit that introduces this regression.
It’s https://github.com/hibernate/hibernate-orm/commit/7b6df34519c061964f877c6fbb1d496ea6b1c735
Unfortunately, the commit is quite big, so I’m not sure which change exactly is responsible for this.
In one of my applications, we use an attribute converter to store zoneddatetime objects as human-readable strings in the database.
This works just fine with hibernate 5.6.11 and even 6.1.1, but in hibernate 6.1.2 and newer it suddenly breaks when comparing dates.
Normal crud operations work as intended.
The error message with hibernate >6.1.1 is:
java.lang.IllegalArgumentException: Unsure how to handle given Java type [java.lang.String] as TemporalType#TIMESTAMP
I’ve created a small sample project to showcase the behavior:
https://github.com/123Haynes/hibernate-test-case-HHH-15605
Simply change the Hibernate Version to 6.1.1 and the test will pass. Anything newer, and it will fail.
I tested this with a h2 and a hsql database, same error so I don’t think it’s database specific.
I’m not sure if I missed something that I need to change in the release notes, or if this usecase is really broken.
Any help with this would be greatly appreciated.