From 509db7cc795bb444389c318c2c408cf428a109e5 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Mon, 10 Aug 2020 11:47:17 +0100 Subject: [PATCH] HHH-14126 Add CockroachDB to DefaultDialectSelector and update documentation to mention the new dialect --- .../asciidoc/userguide/chapters/jdbc/Database_Access.adoc | 4 +++- .../selector/internal/DefaultDialectSelector.java | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc b/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc index c321d4ae07..5d85e36f9a 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc @@ -264,7 +264,9 @@ If for some reason it is not able to determine the proper one or you want to use [width="100%",cols="28%,72%",options="header",] |======================================================================= |Dialect (short name) |Remarks -|Cache71 |Support for the Caché database, version 2007.1 +|Cache71 |Support for the Caché database, version 2007.1. +|CockroachDB192 |Support for the CockroachDB database version 19.2. +|CockroachDB201 |Support for the CockroachDB database version 20.1. |CUBRID |Support for the CUBRID database, version 8.3. May work with later versions. |DB2 |Support for the DB2 database, version 8.2. |DB297 |Support for the DB2 database, version 9.7. diff --git a/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/DefaultDialectSelector.java b/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/DefaultDialectSelector.java index 574acfcc03..451636d4db 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/DefaultDialectSelector.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/DefaultDialectSelector.java @@ -10,6 +10,8 @@ import java.util.Objects; import org.hibernate.dialect.CUBRIDDialect; import org.hibernate.dialect.Cache71Dialect; +import org.hibernate.dialect.CockroachDB192Dialect; +import org.hibernate.dialect.CockroachDB201Dialect; import org.hibernate.dialect.DB2390Dialect; import org.hibernate.dialect.DB2390V8Dialect; import org.hibernate.dialect.DB2400Dialect; @@ -89,6 +91,12 @@ public class DefaultDialectSelector implements LazyServiceResolver { if ( name.equals( "Cache71" ) ) { return Cache71Dialect.class; } + if ( name.equals( "CockroachDB192" ) ) { + return CockroachDB192Dialect.class; + } + if ( name.equals( "CockroachDB201" ) ) { + return CockroachDB201Dialect.class; + } if ( name.equals( "CUBRID" ) ) { return CUBRIDDialect.class; }