Skip to content

Commit e2426b4

Browse files
MoadElfatihibeikov
authored andcommitted
HHH-19226 remove support for sql version's older than 2016
1 parent 518ddb7 commit e2426b4

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
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

Lines changed: 5 additions & 5 deletions
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;
@@ -20,16 +20,16 @@
2020
import static org.junit.Assert.assertEquals;
2121

2222
/**
23-
* Tests the Limit/Offset handler for {@link SQLServerDialect, v11}.
23+
* Tests the Limit/Offset handler for SQLServerDialect.
2424
*
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

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@
132132
import static org.hibernate.type.descriptor.DateTimeUtils.appendAsTimestampWithMillis;
133133

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

145145
/**
146146
* NOTE : 2100 is the documented limit supposedly - but in my testing, sending
@@ -440,20 +440,19 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
440440
functionFactory.windowFunctions();
441441
functionFactory.inverseDistributionOrderedSetAggregates_windowEmulation();
442442
functionFactory.hypotheticalOrderedSetAggregates_windowEmulation();
443-
if ( getVersion().isSameOrAfter( 13 ) ) {
444-
functionFactory.jsonValue_sqlserver();
445-
functionFactory.jsonQuery_sqlserver();
446-
functionFactory.jsonExists_sqlserver( getVersion().isSameOrAfter( 16 ) );
447-
functionFactory.jsonObject_sqlserver( getVersion().isSameOrAfter( 16 ) );
448-
functionFactory.jsonArray_sqlserver( getVersion().isSameOrAfter( 16 ) );
449-
functionFactory.jsonSet_sqlserver();
450-
functionFactory.jsonRemove_sqlserver();
451-
functionFactory.jsonReplace_sqlserver( getVersion().isSameOrAfter( 16 ) );
452-
functionFactory.jsonInsert_sqlserver( getVersion().isSameOrAfter( 16 ) );
453-
functionFactory.jsonArrayAppend_sqlserver( getVersion().isSameOrAfter( 16 ) );
454-
functionFactory.jsonArrayInsert_sqlserver();
455-
functionFactory.jsonTable_sqlserver();
456-
}
443+
functionFactory.jsonValue_sqlserver();
444+
functionFactory.jsonQuery_sqlserver();
445+
functionFactory.jsonExists_sqlserver( getVersion().isSameOrAfter( 16 ) );
446+
functionFactory.jsonObject_sqlserver( getVersion().isSameOrAfter( 16 ) );
447+
functionFactory.jsonArray_sqlserver( getVersion().isSameOrAfter( 16 ) );
448+
functionFactory.jsonSet_sqlserver();
449+
functionFactory.jsonRemove_sqlserver();
450+
functionFactory.jsonReplace_sqlserver( getVersion().isSameOrAfter( 16 ) );
451+
functionFactory.jsonInsert_sqlserver( getVersion().isSameOrAfter( 16 ) );
452+
functionFactory.jsonArrayAppend_sqlserver( getVersion().isSameOrAfter( 16 ) );
453+
functionFactory.jsonArrayInsert_sqlserver();
454+
functionFactory.jsonTable_sqlserver();
455+
457456
functionFactory.xmlelement_sqlserver();
458457
functionFactory.xmlcomment_sqlserver();
459458
functionFactory.xmlforest_sqlserver();

0 commit comments

Comments
 (0)