diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java index e599cdd144..ca4a526fcd 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java @@ -972,4 +972,19 @@ public class H2LegacyDialect extends Dialect { public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport() { return DmlTargetColumnQualifierSupport.TABLE_ALIAS; } + + @Override + public String getCaseInsensitiveLike() { + if ( getVersion().isSameOrAfter( 1, 4, 194 ) ) { + return "ilike"; + } + else { + return super.getCaseInsensitiveLike(); + } + } + + @Override + public boolean supportsCaseInsensitiveLike() { + return getVersion().isSameOrAfter( 1, 4, 194 ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java index d531b2e844..0b7f025f8c 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java @@ -982,4 +982,15 @@ public class H2Dialect extends Dialect { public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport() { return DmlTargetColumnQualifierSupport.TABLE_ALIAS; } + + @Override + public String getCaseInsensitiveLike() { + return "ilike"; + } + + @Override + public boolean supportsCaseInsensitiveLike(){ + return true; + } + } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java index 44353c6d90..4aac1348bb 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java @@ -153,6 +153,7 @@ public class PostgreSQLDialect extends Dialect { public PostgreSQLDialect(DialectResolutionInfo info) { this( info, PostgreSQLDriverKind.determineKind( info ) ); + registerKeywords( info ); } public PostgreSQLDialect(DatabaseVersion version) {