Hello Vijayasaradhi Danda, 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. |