Skip to content

Commit f32f90f

Browse files
committed
HHH-19226 remove support for sql version's older than 2016
1 parent eb02f85 commit f32f90f

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/dialect/SQLServer2012DialectTestCase.java renamed to hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/SQLServer2012DialectTestCase.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
* SPDX-License-Identifier: Apache-2.0
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
5-
package org.hibernate.orm.test.dialect;
5+
package org.hibernate.community.dialect;
66

77
import java.util.Locale;
88

99
import org.hibernate.dialect.DatabaseVersion;
10-
import org.hibernate.dialect.SQLServerDialect;
10+
import org.hibernate.dialect.Dialect;
1111
import org.hibernate.query.spi.Limit;
1212

1313
import org.junit.After;
@@ -25,11 +25,11 @@
2525
* @author Chris Cranford
2626
*/
2727
public class SQLServer2012DialectTestCase extends BaseUnitTestCase {
28-
private SQLServerDialect dialect;
28+
private Dialect dialect;
2929

3030
@Before
3131
public void setup() {
32-
dialect = new SQLServerDialect( DatabaseVersion.make( 11 ) );
32+
dialect = new SQLServerLegacyDialect( DatabaseVersion.make( 11 ) );
3333
}
3434

3535
@After

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

+15-16
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@
129129
import static org.hibernate.type.descriptor.DateTimeUtils.appendAsTimestampWithMillis;
130130

131131
/**
132-
* A dialect for Microsoft SQL Server 2012 and above.
132+
* A dialect for Microsoft SQL Server 2016 and above.
133133
* <p>
134134
* Please refer to the
135135
* <a href="https://learn.microsoft.com/en-us/sql/t-sql/language-reference">SQL Server documentation</a>.
136136
*
137137
* @author Gavin King
138138
*/
139139
public class SQLServerDialect extends AbstractTransactSQLDialect {
140-
private final static DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 11, 0 );
140+
private final static DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 13, 0 );
141141

142142
/**
143143
* NOTE : 2100 is the documented limit supposedly - but in my testing, sending
@@ -445,20 +445,19 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
445445
functionFactory.windowFunctions();
446446
functionFactory.inverseDistributionOrderedSetAggregates_windowEmulation();
447447
functionFactory.hypotheticalOrderedSetAggregates_windowEmulation();
448-
if ( getVersion().isSameOrAfter( 13 ) ) {
449-
functionFactory.jsonValue_sqlserver();
450-
functionFactory.jsonQuery_sqlserver();
451-
functionFactory.jsonExists_sqlserver( getVersion().isSameOrAfter( 16 ) );
452-
functionFactory.jsonObject_sqlserver( getVersion().isSameOrAfter( 16 ) );
453-
functionFactory.jsonArray_sqlserver( getVersion().isSameOrAfter( 16 ) );
454-
functionFactory.jsonSet_sqlserver();
455-
functionFactory.jsonRemove_sqlserver();
456-
functionFactory.jsonReplace_sqlserver( getVersion().isSameOrAfter( 16 ) );
457-
functionFactory.jsonInsert_sqlserver( getVersion().isSameOrAfter( 16 ) );
458-
functionFactory.jsonArrayAppend_sqlserver( getVersion().isSameOrAfter( 16 ) );
459-
functionFactory.jsonArrayInsert_sqlserver();
460-
functionFactory.jsonTable_sqlserver();
461-
}
448+
functionFactory.jsonValue_sqlserver();
449+
functionFactory.jsonQuery_sqlserver();
450+
functionFactory.jsonExists_sqlserver( getVersion().isSameOrAfter( 16 ) );
451+
functionFactory.jsonObject_sqlserver( getVersion().isSameOrAfter( 16 ) );
452+
functionFactory.jsonArray_sqlserver( getVersion().isSameOrAfter( 16 ) );
453+
functionFactory.jsonSet_sqlserver();
454+
functionFactory.jsonRemove_sqlserver();
455+
functionFactory.jsonReplace_sqlserver( getVersion().isSameOrAfter( 16 ) );
456+
functionFactory.jsonInsert_sqlserver( getVersion().isSameOrAfter( 16 ) );
457+
functionFactory.jsonArrayAppend_sqlserver( getVersion().isSameOrAfter( 16 ) );
458+
functionFactory.jsonArrayInsert_sqlserver();
459+
functionFactory.jsonTable_sqlserver();
460+
462461
functionFactory.xmlelement_sqlserver();
463462
functionFactory.xmlcomment_sqlserver();
464463
functionFactory.xmlforest_sqlserver();

0 commit comments

Comments
 (0)