Skip to content

Commit 3dec1ca

Browse files
jrenaatbeikov
authored andcommitted
HHH-15447 - Remove references to deprecated dialects
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 89f9011 commit 3dec1ca

File tree

43 files changed

+174
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+174
-139
lines changed

documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ strategy Class name::
2121
[[configurations-general]]
2222
=== General configuration
2323

24-
`*hibernate.dialect*` (e.g. `org.hibernate.dialect.PostgreSQL94Dialect`)::
24+
`*hibernate.dialect*` (e.g. `org.hibernate.dialect.PostgreSQLDialect`)::
2525
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.
2626
+
2727
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.

documentation/src/test/java/org/hibernate/userguide/mapping/generated/GeneratedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import org.hibernate.annotations.Generated;
1414
import org.hibernate.annotations.GenerationTime;
15-
import org.hibernate.dialect.SQLServer2005Dialect;
15+
import org.hibernate.dialect.SQLServerDialect;
1616

1717
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;
1818
import org.hibernate.testing.orm.junit.Jpa;
@@ -24,7 +24,7 @@
2424
/**
2525
* @author Vlad Mihalcea
2626
*/
27-
@RequiresDialect(value = SQLServer2005Dialect.class, majorVersion = 9)
27+
@RequiresDialect(value = SQLServerDialect.class)
2828
@Jpa(
2929
annotatedClasses = GeneratedTest.Person.class
3030
)

etc/hibernate.properties

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate
6161

6262
## Oracle
6363

64-
#hibernate.dialect org.hibernate.dialect.Oracle8iDialect
65-
#hibernate.dialect org.hibernate.dialect.Oracle9iDialect
66-
#hibernate.dialect org.hibernate.dialect.Oracle10gDialect
64+
#hibernate.dialect org.hibernate.dialect.OracleDialect
6765
#hibernate.connection.driver_class oracle.jdbc.OracleDriver
6866
#hibernate.connection.username ora
6967
#hibernate.connection.password ora
@@ -100,7 +98,7 @@ hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate
10098

10199
## DB2/400
102100

103-
#hibernate.dialect org.hibernate.dialect.DB2400Dialect
101+
#hibernate.dialect org.hibernate.dialect.DB2iDialect
104102
#hibernate.connection.username user
105103
#hibernate.connection.password password
106104

etc/hibernate.properties.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ hibernate.connection.url @DB_URL@
8282

8383
## DB2/400
8484

85-
#hibernate.dialect org.hibernate.dialect.DB2400Dialect
85+
#hibernate.dialect org.hibernate.dialect.DB2iDialect
8686
#hibernate.connection.username user
8787
#hibernate.connection.password password
8888

hibernate-c3p0/src/test/java/org/hibernate/test/c3p0/JdbcCompatibilityTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* @author Vlad Mihalcea
2727
*/
28-
@RequiresDialect(value = SQLServerDialect.class, majorVersion = 9)
28+
@RequiresDialect(value = SQLServerDialect.class)
2929
@DomainModel(
3030
annotatedClasses = { IrrelevantEntity.class }
3131
)

hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/unit/lockhint/SQLServer2005LockHintsTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.hibernate.community.dialect.SQLServerLegacyDialect;
1212
import org.hibernate.dialect.DatabaseVersion;
1313
import org.hibernate.dialect.Dialect;
14-
import org.hibernate.dialect.SQLServer2005Dialect;
1514
import org.hibernate.orm.test.dialect.unit.lockhint.AbstractLockHintTest;
1615

1716
/**
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
55
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
66
*/
7-
package org.hibernate.orm.test.dialect.unit.sequence;
7+
package org.hibernate.community.dialect.unit.sequence;
88

9-
import org.hibernate.dialect.DB2390Dialect;
9+
import org.hibernate.community.dialect.DB2zLegacyDialect;
1010
import org.hibernate.dialect.Dialect;
11+
import org.hibernate.orm.test.dialect.unit.sequence.AbstractSequenceInformationExtractorTest;
1112
import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorNoOpImpl;
1213
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
1314

@@ -21,7 +22,7 @@ public class DB2390SequenceInformationExtractorTest extends AbstractSequenceInfo
2122

2223
@Override
2324
public Dialect getDialect() {
24-
return new DB2390Dialect();
25+
return new DB2zLegacyDialect();
2526
}
2627

2728
@Override
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
55
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
66
*/
7-
package org.hibernate.orm.test.dialect.unit.sequence;
7+
package org.hibernate.community.dialect.unit.sequence;
88

9-
import org.hibernate.dialect.DB2400Dialect;
9+
import org.hibernate.community.dialect.DB2iLegacyDialect;
1010
import org.hibernate.dialect.Dialect;
11+
import org.hibernate.orm.test.dialect.unit.sequence.AbstractSequenceInformationExtractorTest;
1112
import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorNoOpImpl;
1213
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
1314

@@ -22,7 +23,7 @@ public class DB2400SequenceInformationExtractorTest extends AbstractSequenceInfo
2223

2324
@Override
2425
public Dialect getDialect() {
25-
return new DB2400Dialect();
26+
return new DB2iLegacyDialect();
2627
}
2728

2829
@Override

hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
package org.hibernate.dialect;
88

9-
import org.hibernate.dialect.identity.DB2390IdentityColumnSupport;
9+
import org.hibernate.dialect.identity.DB2zIdentityColumnSupport;
1010
import org.hibernate.dialect.identity.IdentityColumnSupport;
1111
import org.hibernate.dialect.pagination.FetchLimitHandler;
1212
import org.hibernate.dialect.pagination.LimitHandler;
@@ -64,6 +64,6 @@ public LimitHandler getLimitHandler() {
6464

6565
@Override
6666
public IdentityColumnSupport getIdentityColumnSupport() {
67-
return new DB2390IdentityColumnSupport();
67+
return new DB2zIdentityColumnSupport();
6868
}
6969
}

hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
package org.hibernate.dialect;
88

9-
import org.hibernate.dialect.identity.DB2390IdentityColumnSupport;
9+
import org.hibernate.dialect.identity.DB2zIdentityColumnSupport;
1010
import org.hibernate.dialect.identity.IdentityColumnSupport;
1111
import org.hibernate.dialect.pagination.FetchLimitHandler;
1212
import org.hibernate.dialect.pagination.LimitHandler;
@@ -48,6 +48,6 @@ public LimitHandler getLimitHandler() {
4848

4949
@Override
5050
public IdentityColumnSupport getIdentityColumnSupport() {
51-
return new DB2390IdentityColumnSupport();
51+
return new DB2zIdentityColumnSupport();
5252
}
5353
}

hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
package org.hibernate.dialect;
88

99
import org.hibernate.dialect.function.CommonFunctionFactory;
10-
import org.hibernate.dialect.identity.DB2390IdentityColumnSupport;
10+
import org.hibernate.dialect.identity.DB2zIdentityColumnSupport;
1111
import org.hibernate.dialect.identity.DB2IdentityColumnSupport;
1212
import org.hibernate.dialect.identity.IdentityColumnSupport;
1313
import org.hibernate.dialect.pagination.FetchLimitHandler;
@@ -115,7 +115,7 @@ public LimitHandler getLimitHandler() {
115115
public IdentityColumnSupport getIdentityColumnSupport() {
116116
return getVersion().isSameOrAfter(7, 3)
117117
? new DB2IdentityColumnSupport()
118-
: new DB2390IdentityColumnSupport();
118+
: new DB2zIdentityColumnSupport();
119119
}
120120

121121
@Override

hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import jakarta.persistence.TemporalType;
1111

1212
import org.hibernate.dialect.function.CommonFunctionFactory;
13-
import org.hibernate.dialect.identity.DB2390IdentityColumnSupport;
13+
import org.hibernate.dialect.identity.DB2zIdentityColumnSupport;
1414
import org.hibernate.dialect.identity.IdentityColumnSupport;
1515
import org.hibernate.dialect.pagination.LimitHandler;
1616
import org.hibernate.dialect.pagination.OffsetFetchLimitHandler;
@@ -110,7 +110,7 @@ public LimitHandler getLimitHandler() {
110110

111111
@Override
112112
public IdentityColumnSupport getIdentityColumnSupport() {
113-
return new DB2390IdentityColumnSupport();
113+
return new DB2zIdentityColumnSupport();
114114
}
115115

116116
@Override
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
/*
22
* Hibernate, Relational Persistence for Idiomatic Java
33
*
4-
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5-
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
66
*/
77
package org.hibernate.dialect.identity;
88

99
/**
10-
* @author Andrea Boriero
10+
* @author Jan Schatteman
11+
* @deprecated use {@code DB2zIdentityColumnSupport}
1112
*/
12-
public class DB2390IdentityColumnSupport extends DB2IdentityColumnSupport {
13-
@Override
14-
public String getIdentitySelectString(String table, String column, int type) {
15-
return "select identity_val_local() from sysibm.sysdummy1";
16-
}
13+
@Deprecated
14+
public class DB2390IdentityColumnSupport extends DB2zIdentityColumnSupport {
1715
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
6+
*/
7+
package org.hibernate.dialect.identity;
8+
9+
/**
10+
* @author Andrea Boriero
11+
*/
12+
public class DB2zIdentityColumnSupport extends DB2IdentityColumnSupport {
13+
@Override
14+
public String getIdentitySelectString(String table, String column, int type) {
15+
return "select identity_val_local() from sysibm.sysdummy1";
16+
}
17+
}

hibernate-core/src/main/java/org/hibernate/dialect/sequence/DB2zSequenceSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
package org.hibernate.dialect.sequence;
88

99
/**
10-
* Sequence support for {@link org.hibernate.dialect.DB2390Dialect}.
10+
* Sequence support for {@link org.hibernate.dialect.DB2zDialect}.
1111
*
1212
* @author Gavin King
1313
*/

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/enumerated/mappedSuperclass/EnumeratedWithMappedSuperclassTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.hibernate.boot.registry.StandardServiceRegistry;
2222
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
2323
import org.hibernate.cfg.AvailableSettings;
24-
import org.hibernate.dialect.PostgreSQL81Dialect;
24+
import org.hibernate.dialect.PostgreSQLDialect;
2525
import org.hibernate.engine.spi.SessionFactoryImplementor;
2626
import org.hibernate.mapping.PersistentClass;
2727
import org.hibernate.mapping.Property;
@@ -49,7 +49,9 @@ public class EnumeratedWithMappedSuperclassTest extends BaseUnitTestCase {
4949
@Before
5050
public void before() {
5151
ssr = new StandardServiceRegistryBuilder()
52-
.applySetting( AvailableSettings.DIALECT, PostgreSQL81Dialect.class )
52+
.applySetting( AvailableSettings.DIALECT, PostgreSQLDialect.class.getName() )
53+
.applySetting( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "8" )
54+
.applySetting( AvailableSettings.JAKARTA_HBM2DDL_DB_MINOR_VERSION, "1" )
5355
.build();
5456
}
5557

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/lob/OracleSeqIdGenDialect.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

hibernate-core/src/test/java/org/hibernate/orm/test/cfg/BatchVersionedDataConfigTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
import org.hibernate.cfg.AvailableSettings;
2828
import org.hibernate.cfg.Configuration;
2929
import org.hibernate.dialect.H2Dialect;
30-
import org.hibernate.dialect.Oracle10gDialect;
31-
import org.hibernate.dialect.Oracle12cDialect;
32-
import org.hibernate.dialect.Oracle8iDialect;
33-
import org.hibernate.dialect.Oracle9iDialect;
3430
import org.hibernate.dialect.OracleDialect;
3531

3632
import org.junit.After;
@@ -77,31 +73,35 @@ public void testBatchVersionedDataForDialectNotSettingBatchVersionedDataProperty
7773

7874
@Test
7975
public void testBatchVersionedDataForOracle10gDialect() {
80-
cfg.setProperty( AvailableSettings.DIALECT, Oracle10gDialect.class.getName() );
76+
cfg.setProperty( AvailableSettings.DIALECT, OracleDialect.class.getName() );
77+
cfg.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "10" );
8178
sessionFactory = cfg.buildSessionFactory();
8279

8380
assertThat( sessionFactory.getSessionFactoryOptions().isJdbcBatchVersionedData(), is( false ) );
8481
}
8582

8683
@Test
8784
public void testBatchVersionedDataForOracle8iDialect() {
88-
cfg.setProperty( AvailableSettings.DIALECT, Oracle8iDialect.class.getName() );
85+
cfg.setProperty( AvailableSettings.DIALECT, OracleDialect.class.getName() );
86+
cfg.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "8" );
8987
sessionFactory = cfg.buildSessionFactory();
9088

9189
assertThat( sessionFactory.getSessionFactoryOptions().isJdbcBatchVersionedData(), is( false ) );
9290
}
9391

9492
@Test
9593
public void testBatchVersionedDataForOracle9iDialect() {
96-
cfg.setProperty( AvailableSettings.DIALECT, Oracle9iDialect.class.getName() );
94+
cfg.setProperty( AvailableSettings.DIALECT, OracleDialect.class.getName() );
95+
cfg.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "9" );
9796
sessionFactory = cfg.buildSessionFactory();
9897

9998
assertThat( sessionFactory.getSessionFactoryOptions().isJdbcBatchVersionedData(), is( false ) );
10099
}
101100

102101
@Test
103102
public void testBatchVersionedDataForOracle12cDialect() {
104-
cfg.setProperty( AvailableSettings.DIALECT, Oracle12cDialect.class.getName() );
103+
cfg.setProperty( AvailableSettings.DIALECT, OracleDialect.class.getName() );
104+
cfg.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION, "12" );
105105
sessionFactory = cfg.buildSessionFactory();
106106

107107
assertThat( sessionFactory.getSessionFactoryOptions().isJdbcBatchVersionedData(), is( true ) );

hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
2020
import org.hibernate.boot.spi.MetadataImplementor;
2121
import org.hibernate.cfg.Environment;
22-
import org.hibernate.dialect.SybaseASE15Dialect;
2322
import org.hibernate.dialect.SybaseASEDialect;
2423
import org.hibernate.mapping.Component;
2524
import org.hibernate.mapping.Formula;
@@ -163,13 +162,7 @@ public void testComponentQueries() {
163162

164163
s.createQuery( "from Employee e where e.person = :p and 1 = 1 and 2=2" ).setParameter( "p", emp.getPerson() ).list();
165164
s.createQuery( "from Employee e where :p = e.person" ).setParameter( "p", emp.getPerson() ).list();
166-
// The following fails on Sybase due to HHH-3510. When HHH-3510
167-
// is fixed, the check for SybaseASE15Dialect should be removed.
168-
if ( ! ( getDialect() instanceof SybaseASE15Dialect ) ) {
169-
s.createQuery(
170-
"from Employee e where e.person = ('', '', current_timestamp, 0.0, 'steve', '', 0)" )
171-
.list();
172-
}
165+
s.createQuery( "from Employee e where e.person = ('', '', current_timestamp, 0.0, 'steve', '', 0)" ).list();
173166

174167
s.delete( emp );
175168
}

0 commit comments

Comments
 (0)