diff --git a/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc b/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc index 3da3a840ef..588ca08eaa 100644 --- a/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc +++ b/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc @@ -21,7 +21,7 @@ strategy Class name:: [[configurations-general]] === General configuration -`*hibernate.dialect*` (e.g. `org.hibernate.dialect.PostgreSQL94Dialect`):: +`*hibernate.dialect*` (e.g. `org.hibernate.dialect.PostgreSQLDialect`):: The class name of a Hibernate https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/dialect/Dialect.html[`Dialect`] from which Hibernate can generate SQL optimized for a particular relational database. + In most cases, Hibernate can choose the correct https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/dialect/Dialect.html[`Dialect`] implementation based on the JDBC metadata returned by the JDBC driver. diff --git a/documentation/src/test/java/org/hibernate/userguide/mapping/generated/GeneratedTest.java b/documentation/src/test/java/org/hibernate/userguide/mapping/generated/GeneratedTest.java index f7fb536f6f..20aec388ae 100644 --- a/documentation/src/test/java/org/hibernate/userguide/mapping/generated/GeneratedTest.java +++ b/documentation/src/test/java/org/hibernate/userguide/mapping/generated/GeneratedTest.java @@ -12,7 +12,7 @@ import jakarta.persistence.Id; import org.hibernate.annotations.Generated; import org.hibernate.annotations.GenerationTime; -import org.hibernate.dialect.SQLServer2005Dialect; +import org.hibernate.dialect.SQLServerDialect; import org.hibernate.testing.orm.junit.EntityManagerFactoryScope; import org.hibernate.testing.orm.junit.Jpa; @@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author Vlad Mihalcea */ -@RequiresDialect(value = SQLServer2005Dialect.class, majorVersion = 9) +@RequiresDialect(value = SQLServerDialect.class) @Jpa( annotatedClasses = GeneratedTest.Person.class ) diff --git a/etc/hibernate.properties b/etc/hibernate.properties index 5d71e4ca98..e92d9c11db 100644 --- a/etc/hibernate.properties +++ b/etc/hibernate.properties @@ -61,9 +61,7 @@ hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate ## Oracle -#hibernate.dialect org.hibernate.dialect.Oracle8iDialect -#hibernate.dialect org.hibernate.dialect.Oracle9iDialect -#hibernate.dialect org.hibernate.dialect.Oracle10gDialect +#hibernate.dialect org.hibernate.dialect.OracleDialect #hibernate.connection.driver_class oracle.jdbc.OracleDriver #hibernate.connection.username ora #hibernate.connection.password ora @@ -100,7 +98,7 @@ hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate ## DB2/400 -#hibernate.dialect org.hibernate.dialect.DB2400Dialect +#hibernate.dialect org.hibernate.dialect.DB2iDialect #hibernate.connection.username user #hibernate.connection.password password diff --git a/etc/hibernate.properties.template b/etc/hibernate.properties.template index d39c87e0e7..153efc7a44 100644 --- a/etc/hibernate.properties.template +++ b/etc/hibernate.properties.template @@ -82,7 +82,7 @@ hibernate.connection.url @DB_URL@ ## DB2/400 -#hibernate.dialect org.hibernate.dialect.DB2400Dialect +#hibernate.dialect org.hibernate.dialect.DB2iDialect #hibernate.connection.username user #hibernate.connection.password password diff --git a/hibernate-c3p0/src/test/java/org/hibernate/test/c3p0/JdbcCompatibilityTest.java b/hibernate-c3p0/src/test/java/org/hibernate/test/c3p0/JdbcCompatibilityTest.java index d0658eb1ef..0619472e7c 100644 --- a/hibernate-c3p0/src/test/java/org/hibernate/test/c3p0/JdbcCompatibilityTest.java +++ b/hibernate-c3p0/src/test/java/org/hibernate/test/c3p0/JdbcCompatibilityTest.java @@ -25,7 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; * * @author Vlad Mihalcea */ -@RequiresDialect(value = SQLServerDialect.class, majorVersion = 9) +@RequiresDialect(value = SQLServerDialect.class) @DomainModel( annotatedClasses = { IrrelevantEntity.class } ) diff --git a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SQLServer2005LockHintsTest.java b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SQLServer2005LockHintsTest.java index f993dd8a74..ad73eb8ce0 100644 --- a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SQLServer2005LockHintsTest.java +++ b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SQLServer2005LockHintsTest.java @@ -11,7 +11,6 @@ import org.hibernate.LockOptions; import org.hibernate.community.dialect.SQLServerLegacyDialect; import org.hibernate.dialect.DatabaseVersion; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.SQLServer2005Dialect; import org.hibernate.orm.test.dialect.unit.lockhint.AbstractLockHintTest; /** diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2390SequenceInformationExtractorTest.java b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/sequence/DB2390SequenceInformationExtractorTest.java similarity index 79% rename from hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2390SequenceInformationExtractorTest.java rename to hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/sequence/DB2390SequenceInformationExtractorTest.java index 13f0e8a53c..0fb657db2b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2390SequenceInformationExtractorTest.java +++ b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/sequence/DB2390SequenceInformationExtractorTest.java @@ -4,10 +4,11 @@ * 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.orm.test.dialect.unit.sequence; +package org.hibernate.community.dialect.unit.sequence; -import org.hibernate.dialect.DB2390Dialect; +import org.hibernate.community.dialect.DB2zLegacyDialect; import org.hibernate.dialect.Dialect; +import org.hibernate.orm.test.dialect.unit.sequence.AbstractSequenceInformationExtractorTest; import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorNoOpImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; @@ -21,7 +22,7 @@ public class DB2390SequenceInformationExtractorTest extends AbstractSequenceInfo @Override public Dialect getDialect() { - return new DB2390Dialect(); + return new DB2zLegacyDialect(); } @Override diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2400SequenceInformationExtractorTest.java b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/sequence/DB2400SequenceInformationExtractorTest.java similarity index 79% rename from hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2400SequenceInformationExtractorTest.java rename to hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/sequence/DB2400SequenceInformationExtractorTest.java index c0bcb93a2a..0c07836a56 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2400SequenceInformationExtractorTest.java +++ b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/sequence/DB2400SequenceInformationExtractorTest.java @@ -4,10 +4,11 @@ * 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.orm.test.dialect.unit.sequence; +package org.hibernate.community.dialect.unit.sequence; -import org.hibernate.dialect.DB2400Dialect; +import org.hibernate.community.dialect.DB2iLegacyDialect; import org.hibernate.dialect.Dialect; +import org.hibernate.orm.test.dialect.unit.sequence.AbstractSequenceInformationExtractorTest; import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorNoOpImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; @@ -22,7 +23,7 @@ public class DB2400SequenceInformationExtractorTest extends AbstractSequenceInfo @Override public Dialect getDialect() { - return new DB2400Dialect(); + return new DB2iLegacyDialect(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java index 4e883082f1..8ddbdafc12 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java @@ -6,7 +6,7 @@ */ package org.hibernate.dialect; -import org.hibernate.dialect.identity.DB2390IdentityColumnSupport; +import org.hibernate.dialect.identity.DB2zIdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.pagination.FetchLimitHandler; import org.hibernate.dialect.pagination.LimitHandler; @@ -64,6 +64,6 @@ public class DB2390Dialect extends DB2Dialect { @Override public IdentityColumnSupport getIdentityColumnSupport() { - return new DB2390IdentityColumnSupport(); + return new DB2zIdentityColumnSupport(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java index 9efcf09e5c..6e349ed8c8 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java @@ -6,7 +6,7 @@ */ package org.hibernate.dialect; -import org.hibernate.dialect.identity.DB2390IdentityColumnSupport; +import org.hibernate.dialect.identity.DB2zIdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.pagination.FetchLimitHandler; import org.hibernate.dialect.pagination.LimitHandler; @@ -48,6 +48,6 @@ public class DB2400Dialect extends DB2Dialect { @Override public IdentityColumnSupport getIdentityColumnSupport() { - return new DB2390IdentityColumnSupport(); + return new DB2zIdentityColumnSupport(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java index 5eba691d32..035b7025c8 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java @@ -7,7 +7,7 @@ package org.hibernate.dialect; import org.hibernate.dialect.function.CommonFunctionFactory; -import org.hibernate.dialect.identity.DB2390IdentityColumnSupport; +import org.hibernate.dialect.identity.DB2zIdentityColumnSupport; import org.hibernate.dialect.identity.DB2IdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.pagination.FetchLimitHandler; @@ -115,7 +115,7 @@ public class DB2iDialect extends DB2Dialect { public IdentityColumnSupport getIdentityColumnSupport() { return getVersion().isSameOrAfter(7, 3) ? new DB2IdentityColumnSupport() - : new DB2390IdentityColumnSupport(); + : new DB2zIdentityColumnSupport(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java index 0a1f0b1636..4a418b6364 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java @@ -10,7 +10,7 @@ package org.hibernate.dialect; import jakarta.persistence.TemporalType; import org.hibernate.dialect.function.CommonFunctionFactory; -import org.hibernate.dialect.identity.DB2390IdentityColumnSupport; +import org.hibernate.dialect.identity.DB2zIdentityColumnSupport; import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.pagination.LimitHandler; import org.hibernate.dialect.pagination.OffsetFetchLimitHandler; @@ -110,7 +110,7 @@ public class DB2zDialect extends DB2Dialect { @Override public IdentityColumnSupport getIdentityColumnSupport() { - return new DB2390IdentityColumnSupport(); + return new DB2zIdentityColumnSupport(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/identity/DB2390IdentityColumnSupport.java b/hibernate-core/src/main/java/org/hibernate/dialect/identity/DB2390IdentityColumnSupport.java index c7f678ce58..c7a0705591 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/identity/DB2390IdentityColumnSupport.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/identity/DB2390IdentityColumnSupport.java @@ -1,17 +1,15 @@ /* * Hibernate, Relational Persistence for Idiomatic Java * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later. - * See the lgpl.txt file in the root directory or . + * License: GNU Lesser General Public License (LGPL), version 2.1 or later + * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ package org.hibernate.dialect.identity; /** - * @author Andrea Boriero + * @author Jan Schatteman + * @deprecated use {@code DB2zIdentityColumnSupport} */ -public class DB2390IdentityColumnSupport extends DB2IdentityColumnSupport { - @Override - public String getIdentitySelectString(String table, String column, int type) { - return "select identity_val_local() from sysibm.sysdummy1"; - } +@Deprecated +public class DB2390IdentityColumnSupport extends DB2zIdentityColumnSupport { } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/identity/DB2zIdentityColumnSupport.java b/hibernate-core/src/main/java/org/hibernate/dialect/identity/DB2zIdentityColumnSupport.java new file mode 100644 index 0000000000..2a6ed34e09 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/dialect/identity/DB2zIdentityColumnSupport.java @@ -0,0 +1,17 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * 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.identity; + +/** + * @author Andrea Boriero + */ +public class DB2zIdentityColumnSupport extends DB2IdentityColumnSupport { + @Override + public String getIdentitySelectString(String table, String column, int type) { + return "select identity_val_local() from sysibm.sysdummy1"; + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/sequence/DB2zSequenceSupport.java b/hibernate-core/src/main/java/org/hibernate/dialect/sequence/DB2zSequenceSupport.java index b22b4e9fcc..763bd6f8d7 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/sequence/DB2zSequenceSupport.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/sequence/DB2zSequenceSupport.java @@ -7,7 +7,7 @@ package org.hibernate.dialect.sequence; /** - * Sequence support for {@link org.hibernate.dialect.DB2390Dialect}. + * Sequence support for {@link org.hibernate.dialect.DB2zDialect}. * * @author Gavin King */ diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/enumerated/mappedSuperclass/EnumeratedWithMappedSuperclassTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/enumerated/mappedSuperclass/EnumeratedWithMappedSuperclassTest.java index 93a1c79528..096fce8c5f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/enumerated/mappedSuperclass/EnumeratedWithMappedSuperclassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/enumerated/mappedSuperclass/EnumeratedWithMappedSuperclassTest.java @@ -21,7 +21,7 @@ import org.hibernate.boot.MetadataSources; import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; -import org.hibernate.dialect.PostgreSQL81Dialect; +import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; @@ -49,7 +49,9 @@ public class EnumeratedWithMappedSuperclassTest extends BaseUnitTestCase { @Before public void before() { ssr = new StandardServiceRegistryBuilder() - .applySetting( AvailableSettings.DIALECT, PostgreSQL81Dialect.class ) + .applySetting( AvailableSettings.DIALECT, PostgreSQLDialect.class.getName() ) + .applySetting( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "8" ) + .applySetting( AvailableSettings.JAKARTA_HBM2DDL_DB_MINOR_VERSION, "1" ) .build(); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/lob/OracleSeqIdGenDialect.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/lob/OracleSeqIdGenDialect.java deleted file mode 100644 index a35b3afcee..0000000000 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/lob/OracleSeqIdGenDialect.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * 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.orm.test.annotations.lob; - -import org.hibernate.dialect.identity.IdentityColumnSupport; -import org.hibernate.dialect.identity.IdentityColumnSupportImpl; -import org.hibernate.dialect.Oracle10gDialect; - -/** - * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) - */ -public class OracleSeqIdGenDialect extends Oracle10gDialect { - - @Override - public IdentityColumnSupport getIdentityColumnSupport() { - return new IdentityColumnSupportImpl(); - } -} diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/BatchVersionedDataConfigTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/BatchVersionedDataConfigTest.java index 7970fd3104..3a0a8d9490 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/BatchVersionedDataConfigTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/BatchVersionedDataConfigTest.java @@ -27,10 +27,6 @@ import org.hibernate.SessionFactory; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; import org.hibernate.dialect.H2Dialect; -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.junit.After; @@ -77,7 +73,8 @@ public class BatchVersionedDataConfigTest extends BaseUnitTestCase { @Test public void testBatchVersionedDataForOracle10gDialect() { - cfg.setProperty( AvailableSettings.DIALECT, Oracle10gDialect.class.getName() ); + cfg.setProperty( AvailableSettings.DIALECT, OracleDialect.class.getName() ); + cfg.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "10" ); sessionFactory = cfg.buildSessionFactory(); assertThat( sessionFactory.getSessionFactoryOptions().isJdbcBatchVersionedData(), is( false ) ); @@ -85,7 +82,8 @@ public class BatchVersionedDataConfigTest extends BaseUnitTestCase { @Test public void testBatchVersionedDataForOracle8iDialect() { - cfg.setProperty( AvailableSettings.DIALECT, Oracle8iDialect.class.getName() ); + cfg.setProperty( AvailableSettings.DIALECT, OracleDialect.class.getName() ); + cfg.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "8" ); sessionFactory = cfg.buildSessionFactory(); assertThat( sessionFactory.getSessionFactoryOptions().isJdbcBatchVersionedData(), is( false ) ); @@ -93,7 +91,8 @@ public class BatchVersionedDataConfigTest extends BaseUnitTestCase { @Test public void testBatchVersionedDataForOracle9iDialect() { - cfg.setProperty( AvailableSettings.DIALECT, Oracle9iDialect.class.getName() ); + cfg.setProperty( AvailableSettings.DIALECT, OracleDialect.class.getName() ); + cfg.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "9" ); sessionFactory = cfg.buildSessionFactory(); assertThat( sessionFactory.getSessionFactoryOptions().isJdbcBatchVersionedData(), is( false ) ); @@ -101,7 +100,8 @@ public class BatchVersionedDataConfigTest extends BaseUnitTestCase { @Test public void testBatchVersionedDataForOracle12cDialect() { - cfg.setProperty( AvailableSettings.DIALECT, Oracle12cDialect.class.getName() ); + cfg.setProperty( AvailableSettings.DIALECT, OracleDialect.class.getName() ); + cfg.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "12" ); sessionFactory = cfg.buildSessionFactory(); assertThat( sessionFactory.getSessionFactoryOptions().isJdbcBatchVersionedData(), is( true ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java index 3285e61fed..e48e682dd9 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java @@ -19,7 +19,6 @@ import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.boot.spi.MetadataImplementor; import org.hibernate.cfg.Environment; -import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.SybaseASEDialect; import org.hibernate.mapping.Component; import org.hibernate.mapping.Formula; @@ -163,13 +162,7 @@ public class ComponentTest extends BaseSessionFactoryFunctionalTest { s.createQuery( "from Employee e where e.person = :p and 1 = 1 and 2=2" ).setParameter( "p", emp.getPerson() ).list(); s.createQuery( "from Employee e where :p = e.person" ).setParameter( "p", emp.getPerson() ).list(); - // The following fails on Sybase due to HHH-3510. When HHH-3510 - // is fixed, the check for SybaseASE15Dialect should be removed. - if ( ! ( getDialect() instanceof SybaseASE15Dialect ) ) { - s.createQuery( - "from Employee e where e.person = ('', '', current_timestamp, 0.0, 'steve', '', 0)" ) - .list(); - } + s.createQuery( "from Employee e where e.person = ('', '', current_timestamp, 0.0, 'steve', '', 0)" ).list(); s.delete( emp ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/OracleDialectsTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/OracleDialectsTest.java index 53d925c80f..48e850564b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/OracleDialectsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/OracleDialectsTest.java @@ -24,10 +24,7 @@ package org.hibernate.orm.test.dialect; import org.hibernate.cfg.Environment; -import org.hibernate.dialect.Oracle10gDialect; -import org.hibernate.dialect.Oracle12cDialect; -import org.hibernate.dialect.Oracle8iDialect; -import org.hibernate.dialect.Oracle9iDialect; +import org.hibernate.dialect.DatabaseVersion; import org.hibernate.dialect.OracleDialect; import org.junit.Test; @@ -39,25 +36,24 @@ import static org.junit.Assert.assertEquals; /** * @author Andrea Boriero */ - public class OracleDialectsTest { @Test @TestForIssue( jiraKey = "HHH-9990") public void testDefaultBatchVersionDataProperty(){ - Oracle8iDialect oracle8iDialect = new Oracle8iDialect(); - assertEquals( "false", oracle8iDialect.getDefaultProperties().getProperty( Environment.BATCH_VERSIONED_DATA ) ); - OracleDialect oracleDialect = new OracleDialect(); assertEquals( "false", oracleDialect.getDefaultProperties().getProperty( Environment.BATCH_VERSIONED_DATA ) ); - Oracle10gDialect oracle10gDialect = new Oracle10gDialect(); + OracleDialect oracle8iDialect = new OracleDialect( DatabaseVersion.make( 8 ) ); + assertEquals( "false", oracle8iDialect.getDefaultProperties().getProperty( Environment.BATCH_VERSIONED_DATA ) ); + + OracleDialect oracle10gDialect = new OracleDialect( DatabaseVersion.make( 10 ) ); assertEquals( "false", oracle10gDialect.getDefaultProperties().getProperty( Environment.BATCH_VERSIONED_DATA ) ); - Oracle9iDialect oracle9iDialect = new Oracle9iDialect(); + OracleDialect oracle9iDialect = new OracleDialect( DatabaseVersion.make( 9 ) ); assertEquals( "false", oracle9iDialect.getDefaultProperties().getProperty( Environment.BATCH_VERSIONED_DATA ) ); - Oracle12cDialect oracle12cDialect = new Oracle12cDialect(); + OracleDialect oracle12cDialect = new OracleDialect( DatabaseVersion.make( 12 ) ); assertEquals( "true", oracle12cDialect.getDefaultProperties().getProperty( Environment.BATCH_VERSIONED_DATA ) ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/PostgreSQL92DialectTestCase.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/PostgreSQL92DialectTestCase.java index fee3f3076a..09d5439089 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/PostgreSQL92DialectTestCase.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/PostgreSQL92DialectTestCase.java @@ -6,7 +6,8 @@ */ package org.hibernate.orm.test.dialect; -import org.hibernate.dialect.PostgreSQL92Dialect; +import org.hibernate.dialect.DatabaseVersion; +import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseUnitTestCase; @@ -28,7 +29,7 @@ public class PostgreSQL92DialectTestCase extends BaseUnitTestCase { @Test @TestForIssue( jiraKey = "HHH-11647" ) public void testGetAlterTableString() { - PostgreSQL92Dialect dialect = new PostgreSQL92Dialect(); + PostgreSQLDialect dialect = new PostgreSQLDialect( DatabaseVersion.make( 9, 2 ) ); assertEquals("alter table if exists table_name", dialect.getAlterTableString( "table_name" )); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/SQLServer2012DialectTestCase.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/SQLServer2012DialectTestCase.java index 2233c6f9ea..678212f28e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/SQLServer2012DialectTestCase.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/SQLServer2012DialectTestCase.java @@ -8,7 +8,8 @@ package org.hibernate.orm.test.dialect; import java.util.Locale; -import org.hibernate.dialect.SQLServer2012Dialect; +import org.hibernate.dialect.DatabaseVersion; +import org.hibernate.dialect.SQLServerDialect; import org.hibernate.query.spi.Limit; import org.junit.After; @@ -21,16 +22,16 @@ import org.hibernate.testing.junit4.BaseUnitTestCase; import static org.junit.Assert.assertEquals; /** - * Tests the Limit/Offset handler for {@link SQLServer2012Dialect}. + * Tests the Limit/Offset handler for {@link SQLServerDialect, v11}. * * @author Chris Cranford */ public class SQLServer2012DialectTestCase extends BaseUnitTestCase { - private SQLServer2012Dialect dialect; + private SQLServerDialect dialect; @Before public void setup() { - dialect = new SQLServer2012Dialect(); + dialect = new SQLServerDialect( DatabaseVersion.make( 11 ) ); } @After diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SQLServerDialectCollationTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SQLServerDialectCollationTest.java index cbfd87599b..6008c18d34 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SQLServerDialectCollationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SQLServerDialectCollationTest.java @@ -7,7 +7,6 @@ package org.hibernate.orm.test.dialect.functional; import java.io.Serializable; -import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.List; @@ -21,11 +20,7 @@ import org.hibernate.boot.registry.BootstrapServiceRegistry; import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; -import org.hibernate.dialect.SQLServer2005Dialect; import org.hibernate.dialect.SQLServerDialect; -import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess; -import org.hibernate.engine.jdbc.spi.JdbcServices; -import org.hibernate.service.ServiceRegistry; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.TestForIssue; @@ -33,11 +28,9 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.transaction.TransactionUtil; import org.junit.Test; -import org.jboss.logging.Logger; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; /** * used driver hibernate.connection.driver_class com.microsoft.sqlserver.jdbc.SQLServerDriver diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/resolver/DialectFactoryTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/resolver/DialectFactoryTest.java index ff4ef72b37..4e473467e3 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/resolver/DialectFactoryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/resolver/DialectFactoryTest.java @@ -30,7 +30,6 @@ import org.junit.Test; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import java.util.Properties; import static org.junit.Assert.*; @@ -66,8 +65,8 @@ public class DialectFactoryTest extends BaseUnitTestCase { configValues.put( Environment.DIALECT, "H2" ); assertEquals( H2Dialect.class, dialectFactory.buildDialect( configValues, null ).getClass() ); - configValues.put( Environment.DIALECT, "Oracle10g" ); - assertEquals( Oracle10gDialect.class, dialectFactory.buildDialect( configValues, null ).getClass() ); + configValues.put( Environment.DIALECT, "Oracle" ); + assertEquals( OracleDialect.class, dialectFactory.buildDialect( configValues, null ).getClass() ); } @Test diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/locktimeout/OracleLockTimeoutTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/locktimeout/OracleLockTimeoutTest.java index 36f4b6e21c..f69716affe 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/locktimeout/OracleLockTimeoutTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/locktimeout/OracleLockTimeoutTest.java @@ -8,8 +8,9 @@ package org.hibernate.orm.test.dialect.unit.locktimeout; import org.hibernate.LockMode; import org.hibernate.LockOptions; +import org.hibernate.dialect.DatabaseVersion; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.Oracle12cDialect; +import org.hibernate.dialect.OracleDialect; import org.hibernate.testing.junit4.BaseUnitTestCase; import org.junit.Test; @@ -21,7 +22,7 @@ import static org.junit.Assert.assertEquals; */ public class OracleLockTimeoutTest extends BaseUnitTestCase { - private final Dialect dialect = new Oracle12cDialect(); + private final Dialect dialect = new OracleDialect( DatabaseVersion.make( 12 ) ); @Test public void testLockTimeoutNoAliasNoTimeout() { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/locktimeout/PostgreSQLLockTimeoutTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/locktimeout/PostgreSQLLockTimeoutTest.java index 8f4de8fd4d..69e3d830df 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/locktimeout/PostgreSQLLockTimeoutTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/locktimeout/PostgreSQLLockTimeoutTest.java @@ -8,8 +8,9 @@ package org.hibernate.orm.test.dialect.unit.locktimeout; import org.hibernate.LockMode; import org.hibernate.LockOptions; +import org.hibernate.dialect.DatabaseVersion; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.PostgreSQL95Dialect; +import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.testing.junit4.BaseUnitTestCase; import org.junit.Test; @@ -21,7 +22,7 @@ import static org.junit.Assert.assertEquals; */ public class PostgreSQLLockTimeoutTest extends BaseUnitTestCase { - private final Dialect dialect = new PostgreSQL95Dialect(); + private final Dialect dialect = new PostgreSQLDialect( DatabaseVersion.make( 9, 5 ) ); @Test public void testLockTimeoutNoAliasNoTimeout() { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2iSequenceInformationExtractorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2iSequenceInformationExtractorTest.java new file mode 100644 index 0000000000..6b2df94a05 --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2iSequenceInformationExtractorTest.java @@ -0,0 +1,37 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * 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.orm.test.dialect.unit.sequence; + +import org.hibernate.dialect.DB2iDialect; +import org.hibernate.dialect.Dialect; +import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorNoOpImpl; +import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; + +import org.hibernate.testing.TestForIssue; + + +/** + * @author Andrea Boriero + */ +@TestForIssue(jiraKey = "HHH-11470") +public class DB2iSequenceInformationExtractorTest extends AbstractSequenceInformationExtractorTest { + + @Override + public Dialect getDialect() { + return new DB2iDialect(); + } + + @Override + public String expectedQuerySequencesString() { + return null; + } + + @Override + public Class expectedSequenceInformationExtractor() { + return SequenceInformationExtractorNoOpImpl.class; + } +} diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2zSequenceInformationExtractorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2zSequenceInformationExtractorTest.java new file mode 100644 index 0000000000..95925cd3be --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/unit/sequence/DB2zSequenceInformationExtractorTest.java @@ -0,0 +1,36 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * 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.orm.test.dialect.unit.sequence; + +import org.hibernate.dialect.DB2zDialect; +import org.hibernate.dialect.Dialect; +import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorDB2DatabaseImpl; +import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; + +import org.hibernate.testing.TestForIssue; + +/** + * @author Andrea Boriero + */ +@TestForIssue(jiraKey = "HHH-11470") +public class DB2zSequenceInformationExtractorTest extends AbstractSequenceInformationExtractorTest { + + @Override + public Dialect getDialect() { + return new DB2zDialect(); + } + + @Override + public String expectedQuerySequencesString() { + return "select * from sysibm.syssequences"; + } + + @Override + public Class expectedSequenceInformationExtractor() { + return SequenceInformationExtractorDB2DatabaseImpl.class; + } +} diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/procedure/StoreProcedureOutParameterByNameTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/procedure/StoreProcedureOutParameterByNameTest.java index 0fa87c2029..fce6b1480c 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/procedure/StoreProcedureOutParameterByNameTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/procedure/StoreProcedureOutParameterByNameTest.java @@ -24,7 +24,6 @@ import jakarta.persistence.Table; import org.junit.Before; import org.junit.Test; -import org.hibernate.dialect.Oracle10gDialect; import org.hibernate.dialect.OracleDialect; import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess; import org.hibernate.engine.jdbc.spi.JdbcServices; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/procedure/StoreProcedureOutParameterByPositionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/procedure/StoreProcedureOutParameterByPositionTest.java index 7fc9b68a99..ac6a0e74d2 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/procedure/StoreProcedureOutParameterByPositionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/procedure/StoreProcedureOutParameterByPositionTest.java @@ -24,7 +24,6 @@ import jakarta.persistence.Table; import org.junit.Before; import org.junit.Test; -import org.hibernate.dialect.Oracle10gDialect; import org.hibernate.dialect.OracleDialect; import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess; import org.hibernate.engine.jdbc.spi.JdbcServices; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/ColumnLastIndexNotLetterAliasTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/ColumnLastIndexNotLetterAliasTest.java index ef2b7fec3e..1700f4a12e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/ColumnLastIndexNotLetterAliasTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/ColumnLastIndexNotLetterAliasTest.java @@ -9,7 +9,7 @@ package org.hibernate.orm.test.mapping; import java.util.Locale; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.PostgreSQL94Dialect; +import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.mapping.Column; import org.hibernate.testing.TestForIssue; @@ -26,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; */ public class ColumnLastIndexNotLetterAliasTest { // Arbitrarily choose PostgreSQL - private static final Dialect DIALECT = new PostgreSQL94Dialect();; + private static final Dialect DIALECT = new PostgreSQLDialect(); @Test @TestForIssue(jiraKey = "HHH-14720") diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/TriggerGeneratedValuesWithCachingTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/TriggerGeneratedValuesWithCachingTest.java index 6b387944ee..35f6a13b1f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/TriggerGeneratedValuesWithCachingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/TriggerGeneratedValuesWithCachingTest.java @@ -6,7 +6,6 @@ */ package org.hibernate.orm.test.mapping.generated; -import org.hibernate.dialect.Oracle9iDialect; import org.hibernate.dialect.OracleDialect; import org.hibernate.testing.RequiresDialect; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/sql/storedproc/PostgresRefCursorSupportTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/sql/storedproc/PostgresRefCursorSupportTest.java index 553f14b1a8..1df5d7fb5d 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/sql/storedproc/PostgresRefCursorSupportTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/sql/storedproc/PostgresRefCursorSupportTest.java @@ -19,8 +19,6 @@ import org.hibernate.boot.MetadataBuilder; import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject; import org.hibernate.boot.model.relational.SqlStringGenerationContext; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.PostgreSQL81Dialect; -import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.procedure.ProcedureCall; import org.hibernate.procedure.ProcedureOutputs; @@ -53,8 +51,7 @@ public class PostgresRefCursorSupportTest extends BaseSessionFactoryFunctionalTe @Override public boolean appliesToDialect(Dialect dialect) { - return PostgreSQL81Dialect.class.isInstance( dialect ) - || PostgreSQL82Dialect.class.isInstance( dialect ); + return PostgreSQLDialect.class.isInstance( dialect ); } @Override diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/type/TimeAndTimestampTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/type/TimeAndTimestampTest.java index 2164d1a950..63ef79cdbf 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/type/TimeAndTimestampTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/type/TimeAndTimestampTest.java @@ -14,9 +14,7 @@ import jakarta.persistence.Id; import org.hibernate.dialect.AbstractHANADialect; import org.hibernate.dialect.MariaDBDialect; -import org.hibernate.dialect.MySQL8Dialect; import org.hibernate.dialect.MySQLDialect; -import org.hibernate.dialect.Oracle9iDialect; import org.hibernate.dialect.OracleDialect; import org.hibernate.testing.SkipForDialect; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/data/Lobs.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/data/Lobs.java index bcbf432333..e34076140f 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/data/Lobs.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/data/Lobs.java @@ -11,7 +11,7 @@ import java.util.Map; import jakarta.persistence.EntityManager; -import org.hibernate.dialect.PostgreSQL82Dialect; +import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.orm.test.envers.BaseEnversJPAFunctionalTestCase; import org.hibernate.orm.test.envers.Priority; import org.hibernate.testing.DialectChecks; @@ -38,7 +38,7 @@ public class Lobs extends BaseEnversJPAFunctionalTestCase { @Override protected void addConfigOptions(Map options) { super.addConfigOptions( options ); - if ( getDialect() instanceof PostgreSQL82Dialect ) { + if ( getDialect() instanceof PostgreSQLDialect ) { // In PostgreSQL LOBs cannot be used in auto-commit mode. options.put( "hibernate.connection.autocommit", "false" ); } diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/readwriteexpression/ReadWriteExpressionChange.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/readwriteexpression/ReadWriteExpressionChange.java index ce3d8e13ba..4e2d2f1e75 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/readwriteexpression/ReadWriteExpressionChange.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/readwriteexpression/ReadWriteExpressionChange.java @@ -6,12 +6,9 @@ */ package org.hibernate.envers.test.integration.readwriteexpression; -import java.math.BigDecimal; import java.util.List; import jakarta.persistence.EntityManager; -import org.hibernate.dialect.Oracle8iDialect; -import org.hibernate.dialect.OracleDialect; import org.hibernate.orm.test.envers.BaseEnversJPAFunctionalTestCase; import org.hibernate.orm.test.envers.Priority; diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/collection/DetachedMultipleCollectionChangeTest.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/collection/DetachedMultipleCollectionChangeTest.java index 251c8cd95b..48e83002df 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/collection/DetachedMultipleCollectionChangeTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/collection/DetachedMultipleCollectionChangeTest.java @@ -16,7 +16,6 @@ import jakarta.transaction.Status; import jakarta.transaction.TransactionManager; import org.hibernate.cfg.AvailableSettings; import org.hibernate.dialect.CockroachDialect; -import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.dialect.OracleDialect; import org.hibernate.envers.RevisionType; import org.hibernate.envers.enhanced.SequenceIdRevisionEntity; @@ -26,7 +25,6 @@ import org.hibernate.orm.test.envers.entities.collection.MultipleCollectionEntit import org.hibernate.orm.test.envers.entities.collection.MultipleCollectionRefEntity1; import org.hibernate.orm.test.envers.entities.collection.MultipleCollectionRefEntity2; import org.hibernate.testing.SkipForDialect; -import org.hibernate.testing.SkipForDialects; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.jta.TestingJtaBootstrap; import org.hibernate.testing.jta.TestingJtaPlatformImpl; @@ -228,12 +226,8 @@ public class DetachedMultipleCollectionChangeTest extends BaseEnversJPAFunctiona } @Test - @SkipForDialects( value = { - @SkipForDialect(value = CockroachDialect.class, - comment = "requires serial_normalization=sql_sequence setting"), - @SkipForDialect(value = Oracle8iDialect.class, - comment = "Oracle does not support identity key generation") - }) + @SkipForDialect(value = CockroachDialect.class, + comment = "requires serial_normalization=sql_sequence setting") public void testAuditJoinTable() throws Exception { List mceRe1AuditJoinTableInfos = getAuditJoinTableRows( "MCE_RE1_AUD", "MCE_ID", diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/data/LobSerializables.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/data/LobSerializables.java index 4435f650c9..6359c89794 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/data/LobSerializables.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/data/LobSerializables.java @@ -10,7 +10,7 @@ import java.util.Arrays; import java.util.Map; import jakarta.persistence.EntityManager; -import org.hibernate.dialect.PostgreSQL82Dialect; +import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.envers.test.integration.data.LobSerializableTestEntity; import org.hibernate.envers.test.integration.data.SerObject; import org.hibernate.orm.test.envers.BaseEnversJPAFunctionalTestCase; @@ -34,7 +34,7 @@ public class LobSerializables extends BaseEnversJPAFunctionalTestCase { @Override protected void addConfigOptions(Map options) { super.addConfigOptions( options ); - if ( getDialect() instanceof PostgreSQL82Dialect ) { + if ( getDialect() instanceof PostgreSQLDialect ) { // In PostgreSQL LOBs cannot be used in auto-commit mode. options.put( "hibernate.connection.autocommit", "false" ); } diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/tools/OrderSequenceGenerationTest.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/tools/OrderSequenceGenerationTest.java index 28b2a98450..1307409b17 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/tools/OrderSequenceGenerationTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/tools/OrderSequenceGenerationTest.java @@ -13,7 +13,7 @@ import java.util.Map; import jakarta.persistence.EntityManager; import org.hibernate.cfg.AvailableSettings; -import org.hibernate.dialect.Oracle8iDialect; +import org.hibernate.dialect.OracleDialect; import org.hibernate.orm.test.envers.BaseEnversJPAFunctionalTestCase; import org.hibernate.orm.test.envers.entities.StrTestEntity; @@ -66,7 +66,7 @@ public class OrderSequenceGenerationTest extends BaseEnversJPAFunctionalTestCase final String[] createStrings = getDialect().getSequenceSupport().getCreateSequenceStrings( "REVISION_GENERATOR", 1, 1 ); final String content = new String( Files.readAllBytes( createSchema.toPath() ) ).toLowerCase(); for ( int i = 0; i < createStrings.length; ++i ) { - if ( getDialect() instanceof Oracle8iDialect ) { + if ( getDialect() instanceof OracleDialect ) { assertTrue( content.contains( ( createStrings[ i ] + " ORDER" ).toLowerCase() ) ); } else { diff --git a/hibernate-envers/src/test/resources/hibernate.test.session-cfg.xml b/hibernate-envers/src/test/resources/hibernate.test.session-cfg.xml index a1a2ab6acc..b19a2ebe85 100644 --- a/hibernate-envers/src/test/resources/hibernate.test.session-cfg.xml +++ b/hibernate-envers/src/test/resources/hibernate.test.session-cfg.xml @@ -22,7 +22,7 @@ sa - + diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/MySQLIdleConnectionCounter.java b/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/MySQLIdleConnectionCounter.java index d96eeb87e6..b96ef3dbaa 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/MySQLIdleConnectionCounter.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/MySQLIdleConnectionCounter.java @@ -12,7 +12,7 @@ import java.sql.SQLException; import java.sql.Statement; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.MySQL5Dialect; +import org.hibernate.dialect.MySQLDialect; /** * @author Vlad Mihalcea @@ -23,7 +23,7 @@ public class MySQLIdleConnectionCounter implements IdleConnectionCounter { @Override public boolean appliesTo(Class dialect) { - return MySQL5Dialect.class.isAssignableFrom( dialect ); + return MySQLDialect.class.isAssignableFrom( dialect ); } @Override diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/OracleIdleConnectionCounter.java b/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/OracleIdleConnectionCounter.java index f12ebef303..7b89c9cbf6 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/OracleIdleConnectionCounter.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/OracleIdleConnectionCounter.java @@ -12,7 +12,7 @@ import java.sql.SQLException; import java.sql.Statement; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.Oracle10gDialect; +import org.hibernate.dialect.OracleDialect; /** * @author Vlad Mihalcea @@ -23,7 +23,7 @@ public class OracleIdleConnectionCounter implements IdleConnectionCounter { @Override public boolean appliesTo(Class dialect) { - return Oracle10gDialect.class.isAssignableFrom( dialect ); + return OracleDialect.class.isAssignableFrom( dialect ); } @Override diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/PostgreSQLIdleConnectionCounter.java b/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/PostgreSQLIdleConnectionCounter.java index b16e92d546..fa799ff913 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/PostgreSQLIdleConnectionCounter.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/leak/PostgreSQLIdleConnectionCounter.java @@ -12,7 +12,7 @@ import java.sql.SQLException; import java.sql.Statement; import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.PostgreSQL91Dialect; +import org.hibernate.dialect.PostgreSQLDialect; /** * @author Vlad Mihalcea @@ -23,7 +23,7 @@ public class PostgreSQLIdleConnectionCounter implements IdleConnectionCounter { @Override public boolean appliesTo(Class dialect) { - return PostgreSQL91Dialect.class.isAssignableFrom( dialect ); + return PostgreSQLDialect.class.isAssignableFrom( dialect ); } @Override