Burner (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6423fd4...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYjRhMWRkNTYx...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16393?atlOrigin=eyJpIjoiYjRhMW...
) HHH-16393 (
https://hibernate.atlassian.net/browse/HHH-16393?atlOrigin=eyJpIjoiYjRhMW...
) Bug HHH-8697 seems to be alive in Spring Boot 3.0.4 with Hibernate 6.1.7 (
https://hibernate.atlassian.net/browse/HHH-16393?atlOrigin=eyJpIjoiYjRhMW...
)
Change By: Burner (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6423fd4...
)
Bug HHH-8697 seems to be alive in Spring Boot 3.0.4 with Hibernate 6.1.7 only in reverse.
I wrote a very simple SQL in a JPA repo and I am wondering that it does not work:
{noformat}@Query("SELECT a FROM #{#entityName} a WHERE ((:#{#iValue} IS NULL AND
a.value IS NULL) OR a.value = :#{#iValue})")
MyEntity findByValue(@Param("iValue") MyDataType value)
{noformat}
and get the error message:
{noformat}Could not determine recommended JdbcType for org.example.MyDataType
{noformat}
I have now found out that it is based on the check with NULL and the value is not NULL.
That means the upper query works without the error message if {{value == null}}. If
{{value != null}}, the above error message comes.
EDIT:
I found a working solution, without #{#…} works like a charm:
{noformat}@Query("SELECT a FROM #{#entityName} a WHERE ((:iValue IS NULL AND a.value
IS NULL) OR a.value = :iValue)")
MyEntity findByValue(@Param("iValue") MyDataType value){noformat}
(
https://hibernate.atlassian.net/browse/HHH-16393#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16393#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- sha1:6a6077b )