From 39f4fdda5ebfe8e437930e141e058122d96b68fb Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Wed, 15 Mar 2023 20:07:19 +0100 Subject: [PATCH] HHH-16316 Move version specific dialects of unsupported versions to hibernate-community-dialects --- .../chapters/domain/inheritance.adoc | 17 ---- .../schema/SchemaGenerationTest.hbm.xml | 2 +- .../dialect/CommunityDialectSelector.java | 52 +++++++++++ .../community}/dialect/DB2390Dialect.java | 5 +- .../community}/dialect/DB2390V8Dialect.java | 2 +- .../community}/dialect/DB297Dialect.java | 6 +- .../dialect/DerbyTenFiveDialect.java | 6 +- .../dialect/DerbyTenSevenDialect.java | 6 +- .../dialect/DerbyTenSixDialect.java | 6 +- .../community}/dialect/MariaDB102Dialect.java | 6 +- .../community}/dialect/MariaDB10Dialect.java | 6 +- .../community}/dialect/MariaDB53Dialect.java | 6 +- .../community}/dialect/MySQL55Dialect.java | 6 +- .../community}/dialect/MySQL5Dialect.java | 6 +- .../community}/dialect/Oracle10gDialect.java | 6 +- .../community}/dialect/Oracle8iDialect.java | 6 +- .../community}/dialect/Oracle9iDialect.java | 6 +- .../dialect/PostgreSQL81Dialect.java | 6 +- .../dialect/PostgreSQL82Dialect.java | 6 +- .../dialect/PostgreSQL91Dialect.java | 6 +- .../dialect/PostgreSQL92Dialect.java | 6 +- .../dialect/PostgreSQL93Dialect.java | 6 +- .../dialect/PostgreSQL94Dialect.java | 6 +- .../dialect/PostgreSQL95Dialect.java | 6 +- .../dialect/PostgreSQL9Dialect.java | 6 +- .../dialect/SQLServer2005Dialect.java | 6 +- .../community}/dialect/Sybase11Dialect.java | 8 +- .../dialect/SybaseASE157Dialect.java | 6 +- .../dialect/SybaseASE15Dialect.java | 6 +- .../dialect/CommunityDialectSelectorTest.java | 37 ++++++++ .../dialect/SQLServer2005DialectTestCase.java | 1 - .../lockhint/SybaseASE15LockHintsTest.java | 1 - .../internal/DefaultDialectSelector.java | 88 ++++++++----------- .../java/org/hibernate/dialect/Dialect.java | 2 +- .../org/hibernate/dialect/MySQLDialect.java | 5 -- .../dialect/internal/DialectFactoryImpl.java | 43 +++++++++ .../DefaultDialectSelectorTest.java | 19 ++-- .../orm/test/type/OracleLongLobTypeTest.java | 23 ----- .../dialect/mysql/MySQL56SpatialDialect.java | 8 +- .../dialect/mysql/MySQL5SpatialDialect.java | 9 +- .../oracle/OracleSpatial10gDialect.java | 9 +- .../oracle/OracleSpatialSDO10gDialect.java | 10 ++- 42 files changed, 305 insertions(+), 174 deletions(-) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/DB2390Dialect.java (92%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/DB2390V8Dialect.java (92%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/DB297Dialect.java (75%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/DerbyTenFiveDialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/DerbyTenSevenDialect.java (74%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/DerbyTenSixDialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/MariaDB102Dialect.java (71%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/MariaDB10Dialect.java (71%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/MariaDB53Dialect.java (73%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/MySQL55Dialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/MySQL5Dialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/Oracle10gDialect.java (79%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/Oracle8iDialect.java (73%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/Oracle9iDialect.java (79%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/PostgreSQL81Dialect.java (71%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/PostgreSQL82Dialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/PostgreSQL91Dialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/PostgreSQL92Dialect.java (77%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/PostgreSQL93Dialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/PostgreSQL94Dialect.java (75%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/PostgreSQL95Dialect.java (75%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/PostgreSQL9Dialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/SQLServer2005Dialect.java (75%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/Sybase11Dialect.java (66%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/SybaseASE157Dialect.java (76%) rename {hibernate-core/src/main/java/org/hibernate => hibernate-community-dialects/src/main/java/org/hibernate/community}/dialect/SybaseASE15Dialect.java (76%) diff --git a/documentation/src/main/asciidoc/userguide/chapters/domain/inheritance.adoc b/documentation/src/main/asciidoc/userguide/chapters/domain/inheritance.adoc index ef499bcab8..0ae98641ea 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/domain/inheritance.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/domain/inheritance.adoc @@ -312,23 +312,6 @@ include::{extrasdir}/entity-inheritance-table-per-class-query-example.sql[] [IMPORTANT] ==== Polymorphic queries require multiple UNION queries, so be aware of the performance implications of a large class hierarchy. - -Unfortunately, not all database systems support UNION ALL, in which case, UNION is going to be used instead of UNION ALL. - -The following Hibernate dialects support UNION ALL: - -- `AbstractHANADialect` -- `AbstractTransactSQLDialect` -- `CUBRIDDialect` -- `DB2Dialect` -- `H2Dialect` -- `HSQLDialect` -- `Ingres9Dialect` -- `MySQL5Dialect` -- `Oracle8iDialect` -- `Oracle9Dialect` -- `PostgreSQL81Dialect` -- `RDMSOS2200Dialect` ==== [[entity-inheritance-polymorphism]] diff --git a/documentation/src/test/java/org/hibernate/userguide/schema/SchemaGenerationTest.hbm.xml b/documentation/src/test/java/org/hibernate/userguide/schema/SchemaGenerationTest.hbm.xml index 89f668dfaa..00be9ad86c 100644 --- a/documentation/src/test/java/org/hibernate/userguide/schema/SchemaGenerationTest.hbm.xml +++ b/documentation/src/test/java/org/hibernate/userguide/schema/SchemaGenerationTest.hbm.xml @@ -20,6 +20,6 @@ LANGUAGE plpgsql; - + \ No newline at end of file diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CommunityDialectSelector.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CommunityDialectSelector.java index 2025ce7928..0c7a9167ad 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CommunityDialectSelector.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CommunityDialectSelector.java @@ -20,12 +20,24 @@ public class CommunityDialectSelector implements DialectSelector { return null; } switch ( name ) { + case "DB297": + return DB297Dialect.class; + case "DB2390": + return DB2390Dialect.class; + case "DB2390V8": + return DB2390V8Dialect.class; case "Cache": return CacheDialect.class; case "Cache71": return Cache71Dialect.class; case "CUBRID": return CUBRIDDialect.class; + case "DerbyTenFive": + return DerbyTenFiveDialect.class; + case "DerbyTenSix": + return DerbyTenSixDialect.class; + case "DerbyTenSeven": + return DerbyTenSevenDialect.class; case "Firebird": return FirebirdDialect.class; case "Informix": @@ -38,16 +50,56 @@ public class CommunityDialectSelector implements DialectSelector { return Ingres9Dialect.class; case "Ingres10": return Ingres10Dialect.class; + case "MariaDB53": + return MariaDB53Dialect.class; + case "MariaDB10": + return MariaDB10Dialect.class; + case "MariaDB102": + return MariaDB102Dialect.class; case "MimerSQL": return MimerSQLDialect.class; + case "MySQL5": + return MySQL5Dialect.class; + case "MySQL55": + return MySQL55Dialect.class; + case "Oracle8i": + return Oracle8iDialect.class; + case "Oracle9i": + return Oracle9iDialect.class; + case "Oracle10g": + return Oracle10gDialect.class; + case "PostgreSQL81": + return PostgreSQL81Dialect.class; + case "PostgreSQL82": + return PostgreSQL82Dialect.class; + case "PostgreSQL9": + return PostgreSQL9Dialect.class; + case "PostgreSQL91": + return PostgreSQL91Dialect.class; + case "PostgreSQL92": + return PostgreSQL92Dialect.class; + case "PostgreSQL93": + return PostgreSQL93Dialect.class; + case "PostgreSQL94": + return PostgreSQL94Dialect.class; + case "PostgreSQL95": + return PostgreSQL95Dialect.class; case "RDMSOS2200": return RDMSOS2200Dialect.class; case "SAPDB": return SAPDBDialect.class; + case "SQLServer2005": + return SQLServer2005Dialect.class; case "MaxDB": return MaxDBDialect.class; + case "Sybase11": + return Sybase11Dialect.class; case "SybaseAnywhere": return SybaseAnywhereDialect.class; + case "SybaseASE15": + return SybaseASE15Dialect.class; + case "SybaseASE157": + return SybaseASE157Dialect.class; case "Teradata": return TeradataDialect.class; case "Teradata14": diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2390Dialect.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2390Dialect.java index 8ddbdafc12..238ab1d697 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2390Dialect.java @@ -4,8 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; +import org.hibernate.dialect.DB2zDialect; import org.hibernate.dialect.identity.DB2zIdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.pagination.FetchLimitHandler; @@ -24,7 +25,7 @@ import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; * @deprecated Use {@link DB2zDialect} */ @Deprecated -public class DB2390Dialect extends DB2Dialect { +public class DB2390Dialect extends DB2LegacyDialect { private final int version; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2390V8Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2390V8Dialect.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/dialect/DB2390V8Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2390V8Dialect.java index d96792dd56..6882665a57 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2390V8Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2390V8Dialect.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; /** diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB297Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB297Dialect.java similarity index 75% rename from hibernate-core/src/main/java/org/hibernate/dialect/DB297Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB297Dialect.java index 0970aa569d..18b1f3d406 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB297Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB297Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for DB2 9.7. @@ -13,7 +15,7 @@ package org.hibernate.dialect; * @deprecated use {@code DB2Dialect(970)} */ @Deprecated -public class DB297Dialect extends DB2Dialect { +public class DB297Dialect extends DB2LegacyDialect { public DB297Dialect() { super( DatabaseVersion.make( 9, 7 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenFiveDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenFiveDialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenFiveDialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenFiveDialect.java index 5896ae4b75..2527f37c44 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenFiveDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenFiveDialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * Dialect for Derby/Cloudscape 10.5 @@ -15,7 +17,7 @@ package org.hibernate.dialect; * @deprecated use {@code DerbyDialect(1050)} */ @Deprecated -public class DerbyTenFiveDialect extends DerbyDialect { +public class DerbyTenFiveDialect extends DerbyLegacyDialect { public DerbyTenFiveDialect() { super( DatabaseVersion.make( 10, 5 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenSevenDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenSevenDialect.java similarity index 74% rename from hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenSevenDialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenSevenDialect.java index c1248dc68c..6e73130859 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenSevenDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenSevenDialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * Dialect for Derby 10.7 @@ -14,7 +16,7 @@ package org.hibernate.dialect; * @deprecated use {@code DerbyDialect(1070)} */ @Deprecated -public class DerbyTenSevenDialect extends DerbyDialect { +public class DerbyTenSevenDialect extends DerbyLegacyDialect { public DerbyTenSevenDialect() { super( DatabaseVersion.make( 10, 7 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenSixDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenSixDialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenSixDialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenSixDialect.java index dcc7b58553..6309dd31ae 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyTenSixDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyTenSixDialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * Dialect for Derby/Cloudscape 10.6 @@ -15,7 +17,7 @@ package org.hibernate.dialect; * @deprecated use {@code DerbyDialect(1060)} */ @Deprecated -public class DerbyTenSixDialect extends DerbyDialect { +public class DerbyTenSixDialect extends DerbyLegacyDialect { public DerbyTenSixDialect() { super( DatabaseVersion.make( 10, 6 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB102Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB102Dialect.java similarity index 71% rename from hibernate-core/src/main/java/org/hibernate/dialect/MariaDB102Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB102Dialect.java index 9712b5eec3..962b848d7d 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB102Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB102Dialect.java @@ -4,13 +4,15 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * @deprecated use {@code MariaDBDialect(1020)} */ @Deprecated -public class MariaDB102Dialect extends MariaDBDialect { +public class MariaDB102Dialect extends MariaDBLegacyDialect { public MariaDB102Dialect() { super( DatabaseVersion.make( 10, 2 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB10Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB10Dialect.java similarity index 71% rename from hibernate-core/src/main/java/org/hibernate/dialect/MariaDB10Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB10Dialect.java index 1de6e150d2..c09ac07555 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB10Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB10Dialect.java @@ -4,13 +4,15 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * @deprecated use {@code MariaDBDialect(1000)} */ @Deprecated -public class MariaDB10Dialect extends MariaDBDialect { +public class MariaDB10Dialect extends MariaDBLegacyDialect { public MariaDB10Dialect() { super( DatabaseVersion.make( 10 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB53Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB53Dialect.java similarity index 73% rename from hibernate-core/src/main/java/org/hibernate/dialect/MariaDB53Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB53Dialect.java index 91bd81dccc..2e10240167 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB53Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MariaDB53Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * @author Vlad Mihalcea @@ -12,7 +14,7 @@ package org.hibernate.dialect; * @deprecated use {@code MariaDBDialect(530)} */ @Deprecated -public class MariaDB53Dialect extends MariaDBDialect { +public class MariaDB53Dialect extends MariaDBLegacyDialect { public MariaDB53Dialect() { super( DatabaseVersion.make( 5, 3 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MySQL55Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQL55Dialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/MySQL55Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQL55Dialect.java index bb69bf2629..b93ef50e48 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MySQL55Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQL55Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for MySQL 5.5.x specific features. @@ -14,7 +16,7 @@ package org.hibernate.dialect; * @deprecated use {@code MySQLDialect(550)} */ @Deprecated -public class MySQL55Dialect extends MySQLDialect { +public class MySQL55Dialect extends MySQLLegacyDialect { public MySQL55Dialect() { super( DatabaseVersion.make( 5, 5 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MySQL5Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQL5Dialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/MySQL5Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQL5Dialect.java index 115431e4d7..30d8c79dc1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MySQL5Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQL5Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for MySQL 5.x specific features. @@ -14,7 +16,7 @@ package org.hibernate.dialect; * @deprecated use {@code MySQLDialect(500)} */ @Deprecated -public class MySQL5Dialect extends MySQLDialect { +public class MySQL5Dialect extends MySQLLegacyDialect { public MySQL5Dialect() { super( DatabaseVersion.make( 5 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle10gDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle10gDialect.java similarity index 79% rename from hibernate-core/src/main/java/org/hibernate/dialect/Oracle10gDialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle10gDialect.java index 4c3447872e..7028ce91a4 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle10gDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle10gDialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * A dialect specifically for use with Oracle 10g. @@ -18,7 +20,7 @@ package org.hibernate.dialect; * @deprecated use {@code OracleDialect(10)} */ @Deprecated -public class Oracle10gDialect extends OracleDialect { +public class Oracle10gDialect extends OracleLegacyDialect { public Oracle10gDialect() { super( DatabaseVersion.make( 10 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle8iDialect.java similarity index 73% rename from hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle8iDialect.java index cf3b2c4a8a..936f042312 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle8iDialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * A dialect for Oracle 8i databases. @@ -12,7 +14,7 @@ package org.hibernate.dialect; * @deprecated use {@code OracleDialect(8)} */ @Deprecated -public class Oracle8iDialect extends OracleDialect { +public class Oracle8iDialect extends OracleLegacyDialect { public Oracle8iDialect() { super( DatabaseVersion.make( 8 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9iDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle9iDialect.java similarity index 79% rename from hibernate-core/src/main/java/org/hibernate/dialect/Oracle9iDialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle9iDialect.java index daa6709ec8..d0791f3bdf 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9iDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Oracle9iDialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * A dialect for Oracle 9i databases. @@ -17,7 +19,7 @@ package org.hibernate.dialect; * @deprecated use {@code OracleDialect(9)} */ @Deprecated -public class Oracle9iDialect extends OracleDialect { +public class Oracle9iDialect extends OracleLegacyDialect { public Oracle9iDialect() { super( DatabaseVersion.make( 9 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL81Dialect.java similarity index 71% rename from hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL81Dialect.java index da9e266c14..fe2bdb4288 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL81Dialect.java @@ -4,13 +4,15 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * @deprecated use {@code PostgreSQLDialect(810)} */ @Deprecated -public class PostgreSQL81Dialect extends PostgreSQLDialect { +public class PostgreSQL81Dialect extends PostgreSQLLegacyDialect { public PostgreSQL81Dialect() { super( DatabaseVersion.make( 8, 1 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL82Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL82Dialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL82Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL82Dialect.java index 7eb38d45d7..08be54f7a5 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL82Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL82Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for Postgres 8.2 and later, adds support for "if exists" when dropping tables @@ -14,7 +16,7 @@ package org.hibernate.dialect; * @deprecated use {@code PostgreSQLDialect(820)} */ @Deprecated -public class PostgreSQL82Dialect extends PostgreSQLDialect { +public class PostgreSQL82Dialect extends PostgreSQLLegacyDialect { public PostgreSQL82Dialect() { super( DatabaseVersion.make( 8, 2 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL91Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL91Dialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL91Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL91Dialect.java index 376e87b197..1e6843f4a4 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL91Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL91Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for Postgres 9.1 and later, @@ -15,7 +17,7 @@ package org.hibernate.dialect; * @deprecated use {@code PostgreSQLDialect(910)} */ @Deprecated -public class PostgreSQL91Dialect extends PostgreSQLDialect { +public class PostgreSQL91Dialect extends PostgreSQLLegacyDialect { public PostgreSQL91Dialect() { super( DatabaseVersion.make( 9, 1 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL92Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL92Dialect.java similarity index 77% rename from hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL92Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL92Dialect.java index 37bb81a817..7b5dc480d1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL92Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL92Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for Postgres 9.2 and later, @@ -16,7 +18,7 @@ package org.hibernate.dialect; * @deprecated use {@code PostgreSQLDialect(920)} */ @Deprecated -public class PostgreSQL92Dialect extends PostgreSQLDialect { +public class PostgreSQL92Dialect extends PostgreSQLLegacyDialect { public PostgreSQL92Dialect() { super( DatabaseVersion.make( 9, 2 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL93Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL93Dialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL93Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL93Dialect.java index 6880b68ec4..02d3e66e10 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL93Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL93Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL Dialect for PostgreSQL 9.3 and later. @@ -15,7 +17,7 @@ package org.hibernate.dialect; * @deprecated use {@code PostgreSQLDialect(810)} */ @Deprecated -public class PostgreSQL93Dialect extends PostgreSQLDialect { +public class PostgreSQL93Dialect extends PostgreSQLLegacyDialect { public PostgreSQL93Dialect() { super( DatabaseVersion.make( 9, 3 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL94Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL94Dialect.java similarity index 75% rename from hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL94Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL94Dialect.java index a9df798a3d..a441418112 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL94Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL94Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for Postgres 9.4 and later. @@ -13,7 +15,7 @@ package org.hibernate.dialect; * @deprecated use {@code PostgreSQLDialect(940)} */ @Deprecated -public class PostgreSQL94Dialect extends PostgreSQLDialect { +public class PostgreSQL94Dialect extends PostgreSQLLegacyDialect { public PostgreSQL94Dialect() { super( DatabaseVersion.make( 9, 4 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL95Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL95Dialect.java similarity index 75% rename from hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL95Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL95Dialect.java index d18912c683..d5b69eee2c 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL95Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL95Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for Postgres 9.5 and later. @@ -13,7 +15,7 @@ package org.hibernate.dialect; * @deprecated use {@code PostgreSQLDialect(950)} */ @Deprecated -public class PostgreSQL95Dialect extends PostgreSQLDialect { +public class PostgreSQL95Dialect extends PostgreSQLLegacyDialect { public PostgreSQL95Dialect() { super( DatabaseVersion.make( 9, 5 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL9Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL9Dialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL9Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL9Dialect.java index 359aedfa75..244ef0ea7d 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL9Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQL9Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect for Postgres 9 and later. @@ -15,7 +17,7 @@ package org.hibernate.dialect; * @deprecated use {@code PostgreSQLDialect(900)} */ @Deprecated -public class PostgreSQL9Dialect extends PostgreSQLDialect { +public class PostgreSQL9Dialect extends PostgreSQLLegacyDialect { public PostgreSQL9Dialect() { super( DatabaseVersion.make( 9 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServer2005Dialect.java similarity index 75% rename from hibernate-core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServer2005Dialect.java index 27d89fca8d..fe25766b58 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServer2005Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * A dialect for Microsoft SQL Server 2005. @@ -15,7 +17,7 @@ package org.hibernate.dialect; * @deprecated use {@code SQLServerDialect(9)} */ @Deprecated -public class SQLServer2005Dialect extends SQLServerDialect { +public class SQLServer2005Dialect extends SQLServerLegacyDialect { public SQLServer2005Dialect() { super( DatabaseVersion.make( 9 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Sybase11Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Sybase11Dialect.java similarity index 66% rename from hibernate-core/src/main/java/org/hibernate/dialect/Sybase11Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Sybase11Dialect.java index 8f913786cb..35b0733d88 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Sybase11Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/Sybase11Dialect.java @@ -4,17 +4,19 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * A SQL dialect suitable for use with Sybase 11.9.2 * (specifically: avoids ANSI JOIN syntax) * * @author Colm O' Flaherty - * @deprecated use {@link SybaseASEDialect} instead + * @deprecated use {@code SybaseASELegacyDialect( DatabaseVersion.make( 11 ) )} */ @Deprecated -public class Sybase11Dialect extends SybaseASEDialect { +public class Sybase11Dialect extends SybaseASELegacyDialect { public Sybase11Dialect() { super( DatabaseVersion.make( 11 ) ); } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASE157Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASE157Dialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/SybaseASE157Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASE157Dialect.java index 6c8e152b4f..c2f993d039 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASE157Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASE157Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect targeting Sybase Adaptive Server Enterprise (ASE) 15.7 and higher. @@ -14,7 +16,7 @@ package org.hibernate.dialect; * @deprecated use {@code SybaseASEDialect(1570)} */ @Deprecated -public class SybaseASE157Dialect extends SybaseASEDialect { +public class SybaseASE157Dialect extends SybaseASELegacyDialect { public SybaseASE157Dialect() { super( DatabaseVersion.make( 15, 7 ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASE15Dialect.java similarity index 76% rename from hibernate-core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java rename to hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASE15Dialect.java index 23091d7683..dde0a36658 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASE15Dialect.java @@ -4,7 +4,9 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.dialect; +package org.hibernate.community.dialect; + +import org.hibernate.dialect.DatabaseVersion; /** * An SQL dialect targeting Sybase Adaptive Server Enterprise (ASE) 15 and higher. @@ -14,7 +16,7 @@ package org.hibernate.dialect; * @deprecated use {@code SybaseASEDialect(1500)} */ @Deprecated -public class SybaseASE15Dialect extends SybaseASEDialect { +public class SybaseASE15Dialect extends SybaseASELegacyDialect { public SybaseASE15Dialect() { super( DatabaseVersion.make( 15 ) ); diff --git a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/CommunityDialectSelectorTest.java b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/CommunityDialectSelectorTest.java index be8343db65..a88887460c 100644 --- a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/CommunityDialectSelectorTest.java +++ b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/CommunityDialectSelectorTest.java @@ -17,16 +17,53 @@ public class CommunityDialectSelectorTest { @Test public void verifyAllDialectNamingResolve() { + testDialectNamingResolution( DB297Dialect.class ); + testDialectNamingResolution( DB2390Dialect.class ); + testDialectNamingResolution( DB2390V8Dialect.class ); + testDialectNamingResolution( Cache71Dialect.class ); testDialectNamingResolution( CUBRIDDialect.class ); + + testDialectNamingResolution( DerbyTenFiveDialect.class ); + testDialectNamingResolution( DerbyTenSixDialect.class ); + testDialectNamingResolution( DerbyTenSevenDialect.class ); + testDialectNamingResolution( FirebirdDialect.class ); testDialectNamingResolution( InformixDialect.class ); testDialectNamingResolution( IngresDialect.class ); testDialectNamingResolution( Ingres9Dialect.class ); testDialectNamingResolution( Ingres10Dialect.class ); testDialectNamingResolution( MimerSQLDialect.class ); + + testDialectNamingResolution( MariaDB53Dialect.class ); + testDialectNamingResolution( MariaDB10Dialect.class ); + testDialectNamingResolution( MariaDB102Dialect.class ); + + testDialectNamingResolution( MySQL5Dialect.class ); + testDialectNamingResolution( MySQL55Dialect.class ); + + testDialectNamingResolution( Oracle8iDialect.class ); + testDialectNamingResolution( Oracle9iDialect.class ); + testDialectNamingResolution( Oracle10gDialect.class ); + + testDialectNamingResolution( PostgreSQL81Dialect.class ); + testDialectNamingResolution( PostgreSQL82Dialect.class ); + testDialectNamingResolution( PostgreSQL9Dialect.class ); + testDialectNamingResolution( PostgreSQL91Dialect.class ); + testDialectNamingResolution( PostgreSQL92Dialect.class ); + testDialectNamingResolution( PostgreSQL93Dialect.class ); + testDialectNamingResolution( PostgreSQL94Dialect.class ); + testDialectNamingResolution( PostgreSQL95Dialect.class ); + testDialectNamingResolution( SAPDBDialect.class ); + + testDialectNamingResolution( SQLServer2005Dialect.class ); + testDialectNamingResolution( SybaseAnywhereDialect.class ); + testDialectNamingResolution( Sybase11Dialect.class ); + testDialectNamingResolution( SybaseASE15Dialect.class ); + testDialectNamingResolution( SybaseASE157Dialect.class ); + testDialectNamingResolution( TeradataDialect.class ); testDialectNamingResolution( TimesTenDialect.class ); } diff --git a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/SQLServer2005DialectTestCase.java b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/SQLServer2005DialectTestCase.java index 4ed8e0c393..637f0563b8 100644 --- a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/SQLServer2005DialectTestCase.java +++ b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/SQLServer2005DialectTestCase.java @@ -11,7 +11,6 @@ import java.util.Locale; import org.hibernate.LockMode; import org.hibernate.LockOptions; import org.hibernate.dialect.DatabaseVersion; -import org.hibernate.dialect.SQLServer2005Dialect; import org.hibernate.query.spi.Limit; import org.hibernate.testing.TestForIssue; diff --git a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SybaseASE15LockHintsTest.java b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SybaseASE15LockHintsTest.java index 3cbc8d07d8..b7898993d7 100644 --- a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SybaseASE15LockHintsTest.java +++ b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SybaseASE15LockHintsTest.java @@ -8,7 +8,6 @@ package org.hibernate.community.dialect.unit.lockhint; import org.hibernate.community.dialect.SybaseASELegacyDialect; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.orm.test.dialect.unit.lockhint.AbstractLockHintTest; /** 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 f7aa51fa96..dd6ae8f943 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 @@ -9,58 +9,35 @@ package org.hibernate.boot.registry.selector.internal; import java.util.Objects; import org.hibernate.boot.registry.selector.spi.DialectSelector; +import org.hibernate.boot.registry.selector.spi.StrategySelectionException; import org.hibernate.dialect.CockroachDialect; -import org.hibernate.dialect.DB2390Dialect; -import org.hibernate.dialect.DB2390V8Dialect; import org.hibernate.dialect.DB2400Dialect; import org.hibernate.dialect.DB2400V7R3Dialect; -import org.hibernate.dialect.DB297Dialect; import org.hibernate.dialect.DB2Dialect; import org.hibernate.dialect.DB2iDialect; import org.hibernate.dialect.DB2zDialect; import org.hibernate.dialect.DerbyDialect; -import org.hibernate.dialect.DerbyTenFiveDialect; -import org.hibernate.dialect.DerbyTenSevenDialect; -import org.hibernate.dialect.DerbyTenSixDialect; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.H2Dialect; import org.hibernate.dialect.HANACloudColumnStoreDialect; import org.hibernate.dialect.HANAColumnStoreDialect; import org.hibernate.dialect.HANARowStoreDialect; import org.hibernate.dialect.HSQLDialect; -import org.hibernate.dialect.MariaDB102Dialect; import org.hibernate.dialect.MariaDB103Dialect; -import org.hibernate.dialect.MariaDB10Dialect; -import org.hibernate.dialect.MariaDB53Dialect; import org.hibernate.dialect.MariaDBDialect; -import org.hibernate.dialect.MySQL55Dialect; import org.hibernate.dialect.MySQL57Dialect; -import org.hibernate.dialect.MySQL5Dialect; import org.hibernate.dialect.MySQL8Dialect; import org.hibernate.dialect.MySQLDialect; -import org.hibernate.dialect.Oracle10gDialect; import org.hibernate.dialect.Oracle12cDialect; -import org.hibernate.dialect.Oracle8iDialect; -import org.hibernate.dialect.Oracle9iDialect; import org.hibernate.dialect.OracleDialect; -import org.hibernate.dialect.PostgreSQL81Dialect; -import org.hibernate.dialect.PostgreSQL82Dialect; -import org.hibernate.dialect.PostgreSQL91Dialect; -import org.hibernate.dialect.PostgreSQL92Dialect; -import org.hibernate.dialect.PostgreSQL93Dialect; -import org.hibernate.dialect.PostgreSQL94Dialect; -import org.hibernate.dialect.PostgreSQL95Dialect; -import org.hibernate.dialect.PostgreSQL9Dialect; +import org.hibernate.dialect.PostgreSQL10Dialect; import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgresPlusDialect; -import org.hibernate.dialect.SQLServer2005Dialect; import org.hibernate.dialect.SQLServer2008Dialect; import org.hibernate.dialect.SQLServer2012Dialect; +import org.hibernate.dialect.SQLServer2016Dialect; import org.hibernate.dialect.SQLServerDialect; import org.hibernate.dialect.SpannerDialect; -import org.hibernate.dialect.Sybase11Dialect; -import org.hibernate.dialect.SybaseASE157Dialect; -import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.SybaseASEDialect; import org.hibernate.dialect.SybaseDialect; @@ -82,11 +59,10 @@ public class DefaultDialectSelector implements DialectSelector { case "DB2z": return DB2zDialect.class; case "DB297": - return DB297Dialect.class; + return findCommunityDialect( name ); case "DB2390": - return DB2390Dialect.class; case "DB2390V8": - return DB2390V8Dialect.class; + return findCommunityDialect( name ); case "DB2400": return DB2400Dialect.class; case "DB2400V7R3": @@ -94,11 +70,9 @@ public class DefaultDialectSelector implements DialectSelector { case "Derby": return DerbyDialect.class; case "DerbyTenFive": - return DerbyTenFiveDialect.class; case "DerbyTenSix": - return DerbyTenSixDialect.class; case "DerbyTenSeven": - return DerbyTenSevenDialect.class; + return findCommunityDialect( name ); case "H2": return H2Dialect.class; case "HANACloudColumnStore": @@ -112,19 +86,16 @@ public class DefaultDialectSelector implements DialectSelector { case "MariaDB": return MariaDBDialect.class; case "MariaDB53": - return MariaDB53Dialect.class; case "MariaDB10": - return MariaDB10Dialect.class; case "MariaDB102": - return MariaDB102Dialect.class; + return findCommunityDialect( name ); case "MariaDB103": return MariaDB103Dialect.class; case "MySQL": return MySQLDialect.class; case "MySQL5": - return MySQL5Dialect.class; case "MySQL55": - return MySQL55Dialect.class; + return findCommunityDialect( name ); case "MySQL57": return MySQL57Dialect.class; case "MySQL8": @@ -132,11 +103,9 @@ public class DefaultDialectSelector implements DialectSelector { case "Oracle": return OracleDialect.class; case "Oracle8i": - return Oracle8iDialect.class; case "Oracle9i": - return Oracle9iDialect.class; case "Oracle10g": - return Oracle10gDialect.class; + return findCommunityDialect( name ); case "Oracle12c": return Oracle12cDialect.class; case "PostgresPlus": @@ -144,43 +113,58 @@ public class DefaultDialectSelector implements DialectSelector { case "PostgreSQL": return PostgreSQLDialect.class; case "PostgreSQL81": - return PostgreSQL81Dialect.class; case "PostgreSQL82": - return PostgreSQL82Dialect.class; case "PostgreSQL9": - return PostgreSQL9Dialect.class; case "PostgreSQL91": - return PostgreSQL91Dialect.class; case "PostgreSQL92": - return PostgreSQL92Dialect.class; case "PostgreSQL93": - return PostgreSQL93Dialect.class; case "PostgreSQL94": - return PostgreSQL94Dialect.class; case "PostgreSQL95": - return PostgreSQL95Dialect.class; + return findCommunityDialect( name ); + case "PostgreSQL10": + return PostgreSQL10Dialect.class; case "Spanner": return SpannerDialect.class; case "SQLServer": return SQLServerDialect.class; case "SQLServer2005": - return SQLServer2005Dialect.class; + return findCommunityDialect( name ); case "SQLServer2008": return SQLServer2008Dialect.class; case "SQLServer2012": return SQLServer2012Dialect.class; + case "SQLServer2016": + return SQLServer2016Dialect.class; case "Sybase": return SybaseDialect.class; case "Sybase11": - return Sybase11Dialect.class; + return findCommunityDialect( name ); case "SybaseASE": return SybaseASEDialect.class; case "SybaseASE15": - return SybaseASE15Dialect.class; case "SybaseASE157": - return SybaseASE157Dialect.class; + return findCommunityDialect( name ); } return null; } + private static Class findCommunityDialect(String name) { + try { + //noinspection unchecked + return (Class) DefaultDialectSelector.class.getClassLoader().loadClass( + "org.hibernate.community.dialect." + name + "Dialect" + ); + } + catch (ClassNotFoundException e) { + throw new StrategySelectionException( + "Couldn't load the dialect class for the `hibernate.dialect` short name [" + name + "], " + + "because the application is missing a dependency on the hibernate-community-dialects module. " + + "Hibernate 6.2 dropped support for database versions that are unsupported by vendors " + + "and code for old versions was moved to the hibernate-community-dialects module. " + + "For further information, read https://in.relation.to/2023/02/15/hibernate-orm-62-db-version-support/", + e + ); + } + } + } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index c1d25a7384..64bc4c28f8 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -278,7 +278,7 @@ import static org.hibernate.type.descriptor.DateTimeUtils.appendAsTimestampWithN * passed to the constructor, and by the {@link #getVersion()} property. *

* Programs using Hibernate should migrate away from the use of versioned - * dialect classes like, for example, {@link PostgreSQL95Dialect}. These + * dialect classes like, for example, {@link MySQL8Dialect}. These * classes are now deprecated and will be removed in a future release. *

* A custom {@code Dialect} may be specified using the configuration diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java index dd7c94c384..0579c95541 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java @@ -861,11 +861,6 @@ public class MySQLDialect extends Dialect { } } - @Override - public boolean supportsUnionAll() { - return true; - } - @Override public SelectItemReferenceStrategy getGroupBySelectItemReferenceStrategy() { return SelectItemReferenceStrategy.POSITION; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/DialectFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/DialectFactoryImpl.java index 97a1c901c3..9d24e337a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/DialectFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/DialectFactoryImpl.java @@ -8,6 +8,7 @@ package org.hibernate.engine.jdbc.dialect.internal; import java.lang.reflect.InvocationTargetException; import java.util.Map; +import java.util.Set; import org.hibernate.HibernateException; import org.hibernate.boot.registry.selector.spi.StrategySelectionException; @@ -33,6 +34,34 @@ import static org.hibernate.internal.log.DeprecationLogger.DEPRECATION_LOGGER; */ public class DialectFactoryImpl implements DialectFactory, ServiceRegistryAwareService { private static final CoreMessageLogger LOG = CoreLogging.messageLogger( "SQL dialect" ); + private static final Set LEGACY_DIALECTS = Set.of( + "org.hibernate.community.dialect.DB297Dialect", + "org.hibernate.community.dialect.DB2390Dialect", + "org.hibernate.community.dialect.DB2390V8Dialect", + "org.hibernate.community.dialect.DerbyTenFiveDialect", + "org.hibernate.community.dialect.DerbyTenSevenDialect", + "org.hibernate.community.dialect.DerbyTenSixDialect", + "org.hibernate.community.dialect.MariaDB10Dialect", + "org.hibernate.community.dialect.MariaDB53Dialect", + "org.hibernate.community.dialect.MariaDB102Dialect", + "org.hibernate.community.dialect.MySQL5Dialect", + "org.hibernate.community.dialect.MySQL55Dialect", + "org.hibernate.community.dialect.Oracle8iDialect", + "org.hibernate.community.dialect.Oracle9iDialect", + "org.hibernate.community.dialect.Oracle10gDialect", + "org.hibernate.community.dialect.PostgreSQL9Dialect", + "org.hibernate.community.dialect.PostgreSQL81Dialect", + "org.hibernate.community.dialect.PostgreSQL82Dialect", + "org.hibernate.community.dialect.PostgreSQL91Dialect", + "org.hibernate.community.dialect.PostgreSQL92Dialect", + "org.hibernate.community.dialect.PostgreSQL93Dialect", + "org.hibernate.community.dialect.PostgreSQL94Dialect", + "org.hibernate.community.dialect.PostgreSQL95Dialect", + "org.hibernate.community.dialect.SQLServer2005Dialect", + "org.hibernate.community.dialect.Sybase11Dialect", + "org.hibernate.community.dialect.SybaseASE15Dialect", + "org.hibernate.community.dialect.SybaseASE157Dialect" + ); private StrategySelector strategySelector; private DialectResolver dialectResolver; @@ -124,6 +153,20 @@ public class DialectFactoryImpl implements DialectFactory, ServiceRegistryAwareS } return dialect; } + catch (StrategySelectionException e) { + final String dialectFqn = dialectReference.toString(); + if ( LEGACY_DIALECTS.contains( dialectFqn ) ) { + throw new StrategySelectionException( + "Couldn't load the dialect class for the `hibernate.dialect` [" + dialectFqn + "], " + + "because the application is missing a dependency on the hibernate-community-dialects module. " + + "Hibernate 6.2 dropped support for database versions that are unsupported by vendors " + + "and code for old versions was moved to the hibernate-community-dialects module. " + + "For further information, read https://in.relation.to/2023/02/15/hibernate-orm-62-db-version-support/", + e + ); + } + throw e; + } catch (HibernateException e) { throw e; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/DefaultDialectSelectorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/DefaultDialectSelectorTest.java index c57c5ef956..1eed41a6e3 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/DefaultDialectSelectorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/DefaultDialectSelectorTest.java @@ -7,6 +7,10 @@ package org.hibernate.orm.test.strategyselectors; import org.hibernate.boot.registry.selector.internal.DefaultDialectSelector; +import org.hibernate.community.dialect.DerbyTenFiveDialect; +import org.hibernate.community.dialect.DerbyTenSevenDialect; +import org.hibernate.community.dialect.DerbyTenSixDialect; +import org.hibernate.community.dialect.MySQL5Dialect; import org.hibernate.dialect.*; import org.junit.jupiter.api.Test; @@ -21,8 +25,6 @@ public class DefaultDialectSelectorTest { @Test public void verifyAllDialectNamingResolve() { testDialectNamingResolution( DB2Dialect.class ); - testDialectNamingResolution( DB2390Dialect.class ); - testDialectNamingResolution( DB2390V8Dialect.class ); testDialectNamingResolution( DB2400Dialect.class ); testDialectNamingResolution( DB2400V7R3Dialect.class ); @@ -42,24 +44,17 @@ public class DefaultDialectSelectorTest { testDialectNamingResolution( MySQL8Dialect.class ); testDialectNamingResolution( OracleDialect.class ); - testDialectNamingResolution( Oracle8iDialect.class ); - testDialectNamingResolution( Oracle9iDialect.class ); - testDialectNamingResolution( Oracle10gDialect.class ); + testDialectNamingResolution( Oracle12cDialect.class ); testDialectNamingResolution( PostgreSQLDialect.class ); testDialectNamingResolution( PostgresPlusDialect.class ); - testDialectNamingResolution( PostgreSQL81Dialect.class ); - testDialectNamingResolution( PostgreSQL82Dialect.class ); - testDialectNamingResolution( PostgreSQL9Dialect.class ); + testDialectNamingResolution( PostgreSQL10Dialect.class ); testDialectNamingResolution( SQLServerDialect.class ); - testDialectNamingResolution( SQLServer2005Dialect.class ); testDialectNamingResolution( SQLServer2008Dialect.class ); + testDialectNamingResolution( SQLServer2012Dialect.class ); testDialectNamingResolution( SybaseDialect.class ); - testDialectNamingResolution( Sybase11Dialect.class ); - testDialectNamingResolution( SybaseASE15Dialect.class ); - testDialectNamingResolution( SybaseASE157Dialect.class ); } private void testDialectNamingResolution(final Class dialectClass) { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/type/OracleLongLobTypeTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/type/OracleLongLobTypeTest.java index 68faca45da..e35108be73 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/type/OracleLongLobTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/type/OracleLongLobTypeTest.java @@ -18,10 +18,7 @@ import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.boot.spi.MetadataImplementor; import org.hibernate.cfg.AvailableSettings; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.Oracle10gDialect; import org.hibernate.dialect.Oracle12cDialect; -import org.hibernate.dialect.Oracle8iDialect; -import org.hibernate.dialect.Oracle9iDialect; import org.hibernate.dialect.OracleDialect; import org.hibernate.mapping.PersistentClass; import org.hibernate.type.BasicType; @@ -42,26 +39,6 @@ import static org.junit.Assert.assertSame; * @author Steve Ebersole */ public class OracleLongLobTypeTest extends BaseUnitTestCase { - @Test - public void testOracle8() { - check( Oracle8iDialect.class, Primitives.class, StandardBasicTypes.BINARY, StandardBasicTypes.CHAR_ARRAY ); - check( Oracle8iDialect.class, LobPrimitives.class, StandardBasicTypes.MATERIALIZED_BLOB, StandardBasicTypes.MATERIALIZED_CLOB_CHAR_ARRAY ); - check( Oracle8iDialect.class, LobLocators.class, StandardBasicTypes.BLOB, StandardBasicTypes.CLOB ); - } - - @Test - public void testOracle9() { - check( Oracle9iDialect.class, Primitives.class, StandardBasicTypes.BINARY, StandardBasicTypes.CHAR_ARRAY ); - check( Oracle9iDialect.class, LobPrimitives.class, StandardBasicTypes.MATERIALIZED_BLOB, StandardBasicTypes.MATERIALIZED_CLOB_CHAR_ARRAY ); - check( Oracle9iDialect.class, LobLocators.class, StandardBasicTypes.BLOB, StandardBasicTypes.CLOB ); - } - - @Test - public void testOracle10() { - check( Oracle10gDialect.class, Primitives.class, StandardBasicTypes.BINARY, StandardBasicTypes.CHAR_ARRAY ); - check( Oracle10gDialect.class, LobPrimitives.class, StandardBasicTypes.MATERIALIZED_BLOB, StandardBasicTypes.MATERIALIZED_CLOB_CHAR_ARRAY ); - check( Oracle10gDialect.class, LobLocators.class, StandardBasicTypes.BLOB, StandardBasicTypes.CLOB ); - } @Test @TestForIssue( jiraKey = "HHH-10345" ) diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java index 5f866f356c..35358fe005 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java @@ -11,7 +11,8 @@ package org.hibernate.spatial.dialect.mysql; * creation-date: 10/9/13 */ -import org.hibernate.dialect.MySQL55Dialect; +import org.hibernate.dialect.DatabaseVersion; +import org.hibernate.dialect.MySQLDialect; import org.hibernate.spatial.SpatialDialect; /** @@ -25,6 +26,9 @@ import org.hibernate.spatial.SpatialDialect; * @deprecated Spatial Dialects are no longer needed */ @Deprecated -public class MySQL56SpatialDialect extends MySQL55Dialect implements SpatialDialect { +public class MySQL56SpatialDialect extends MySQLDialect implements SpatialDialect { + public MySQL56SpatialDialect() { + super( DatabaseVersion.make( 5, 5 ) ); + } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5SpatialDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5SpatialDialect.java index f1ed54d382..a3277104f3 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5SpatialDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5SpatialDialect.java @@ -6,7 +6,8 @@ */ package org.hibernate.spatial.dialect.mysql; -import org.hibernate.dialect.MySQL5Dialect; +import org.hibernate.dialect.DatabaseVersion; +import org.hibernate.dialect.MySQLDialect; import org.hibernate.spatial.SpatialDialect; /** @@ -16,5 +17,9 @@ import org.hibernate.spatial.SpatialDialect; * @deprecated Spatial Dialects are no longer needed */ @Deprecated -public class MySQL5SpatialDialect extends MySQL5Dialect implements SpatialDialect { +public class MySQL5SpatialDialect extends MySQLDialect implements SpatialDialect { + + public MySQL5SpatialDialect() { + super( DatabaseVersion.make( 5 ) ); + } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatial10gDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatial10gDialect.java index 6b7bedebeb..a3d39c3fe6 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatial10gDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatial10gDialect.java @@ -7,7 +7,8 @@ package org.hibernate.spatial.dialect.oracle; -import org.hibernate.dialect.Oracle10gDialect; +import org.hibernate.dialect.DatabaseVersion; +import org.hibernate.dialect.OracleDialect; import org.hibernate.spatial.SpatialDialect; /** @@ -18,6 +19,10 @@ import org.hibernate.spatial.SpatialDialect; * @deprecated A SpatialDialect is no longer required. Use the standard Dialect for this database. */ @Deprecated -public class OracleSpatial10gDialect extends Oracle10gDialect implements SpatialDialect { +public class OracleSpatial10gDialect extends OracleDialect implements SpatialDialect { + + public OracleSpatial10gDialect() { + super( DatabaseVersion.make( 10 ) ); + } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatialSDO10gDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatialSDO10gDialect.java index 6513b62ccb..2ce39463f0 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatialSDO10gDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatialSDO10gDialect.java @@ -6,7 +6,8 @@ */ package org.hibernate.spatial.dialect.oracle; -import org.hibernate.dialect.Oracle10gDialect; +import org.hibernate.dialect.DatabaseVersion; +import org.hibernate.dialect.OracleDialect; import org.hibernate.spatial.SpatialDialect; /** @@ -15,6 +16,9 @@ import org.hibernate.spatial.SpatialDialect; * @deprecated A SpatialDialect is no longer required. Use the standard Dialect for this database. */ @Deprecated -public class OracleSpatialSDO10gDialect extends Oracle10gDialect - implements SpatialDialect { +public class OracleSpatialSDO10gDialect extends OracleDialect implements SpatialDialect { + + public OracleSpatialSDO10gDialect() { + super( DatabaseVersion.make( 10 ) ); + } }