Skip to content

Commit 22f20d8

Browse files
committed
HHH-19226 Revert to SQL Server 2014 instead of 2016 as minimum version
1 parent a00ee60 commit 22f20d8

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

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

Lines changed: 16 additions & 14 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 2016 and above.
135+
* A dialect for Microsoft SQL Server 2014 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( 13, 0 );
143+
private final static DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 12, 0 );
144144

145145
/**
146146
* NOTE : 2100 is the documented limit supposedly - but in my testing, sending
@@ -440,18 +440,20 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
440440
functionFactory.windowFunctions();
441441
functionFactory.inverseDistributionOrderedSetAggregates_windowEmulation();
442442
functionFactory.hypotheticalOrderedSetAggregates_windowEmulation();
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();
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+
}
455457

456458
functionFactory.xmlelement_sqlserver();
457459
functionFactory.xmlcomment_sqlserver();

0 commit comments

Comments
 (0)