From bb90a84505811f067f2f821546a42b6b3f8d534b Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Fri, 5 Jul 2024 16:15:11 +0200 Subject: [PATCH] HHH-18339 Set support filter clause to True for H2 --- .../community/dialect/H2LegacySqlAstTranslator.java | 5 +++++ .../main/java/org/hibernate/dialect/H2SqlAstTranslator.java | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacySqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacySqlAstTranslator.java index 4739a94288..7213cd1690 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacySqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacySqlAstTranslator.java @@ -411,4 +411,9 @@ public class H2LegacySqlAstTranslator extends AbstractS protected boolean supportsJoinInMutationStatementSubquery() { return false; } + + @Override + public boolean supportsFilterClause() { + return getDialect().getVersion().isSameOrAfter( 1, 4, 197 ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/H2SqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/H2SqlAstTranslator.java index 62b049c6c2..4554d948da 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/H2SqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/H2SqlAstTranslator.java @@ -384,4 +384,10 @@ public class H2SqlAstTranslator extends SqlAstTranslato protected boolean supportsJoinInMutationStatementSubquery() { return false; } + + @Override + public boolean supportsFilterClause() { + // Introduction of FILTER clause https://github.com/h2database/h2database/commit/9e6dbf3baa57000f670826ede431dc7fb4cd9d9c + return true; + } }