Marco Belladelli (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=637b480...
) *commented* on HHH-16034 (
https://hibernate.atlassian.net/browse/HHH-16034?atlOrigin=eyJpIjoiYWE4ZT...
)
Re: CASE Statement in jpql throws assertion error when running H2 in Oracle mode with
OracleDialect (
https://hibernate.atlassian.net/browse/HHH-16034?atlOrigin=eyJpIjoiYWE4ZT...
)
Hello Vijayasaradhi Danda (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) , thanks for reporting the issue and providing a reproducer!
Your error is caused by wrong OracleDialect version detection due to the database actually
being H2. This triggers a compatibility mode for CASE statements in Oracle versions before
9 that doesn’t support grouped predicates like the one in your example ( CURRENT_DATE
BETWEEN …).
The issue doesn’t occur with Hibernate 6.2.0 since it removed compatibility for Oracle
versions < 11.2. Since the final version of 6.2.0 will be released shortly I suggest
upgrading to that once it’s available to solve the issue. Another workaround would be
creating a custom dialect (e.g. H2OracleModeDialect ) which extends OracleDialect and
overrides the getVersion() method returing a version >= 9.
(
https://hibernate.atlassian.net/browse/HHH-16034#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16034#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#100214- sha1:b03f6a4 )