@@ -165,11 +165,9 @@ public class OracleDialect extends Dialect {
165
165
private static final String ADD_QUARTER_EXPRESSION = String .format ( yqmSelect , "?2*3" , "?3" );
166
166
private static final String ADD_MONTH_EXPRESSION = String .format ( yqmSelect , "?2" , "?3" );
167
167
168
- private static final DatabaseVersion MINIMUM_VERSION = DatabaseVersion .make ( 11 , 2 );
168
+ private static final DatabaseVersion MINIMUM_VERSION = DatabaseVersion .make ( 19 );
169
169
170
- private final LimitHandler limitHandler = supportsFetchClause ( FetchClauseType .ROWS_ONLY )
171
- ? Oracle12LimitHandler .INSTANCE
172
- : new LegacyOracleLimitHandler ( getVersion () );
170
+ private final LimitHandler limitHandler = Oracle12LimitHandler .INSTANCE ;
173
171
private final UniqueDelegate uniqueDelegate = new CreateTableUniqueDelegate (this );
174
172
175
173
// Is it an Autonomous Database Cloud Service?
@@ -298,12 +296,7 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
298
296
typeConfiguration
299
297
).setArgumentListSignature ("(pattern, string[, start])" );
300
298
// The within group clause became optional in 18
301
- if ( getVersion ().isSameOrAfter ( 18 ) ) {
302
- functionFactory .listagg ( null );
303
- }
304
- else {
305
- functionFactory .listagg ( "within group (order by rownum)" );
306
- }
299
+ functionFactory .listagg ( null );
307
300
functionFactory .windowFunctions ();
308
301
functionFactory .hypotheticalOrderedSetAggregates ();
309
302
functionFactory .inverseDistributionOrderedSetAggregates ();
@@ -374,7 +367,7 @@ public String currentTimestampWithTimeZone() {
374
367
375
368
@ Override
376
369
public boolean supportsInsertReturningGeneratedKeys () {
377
- return getVersion (). isSameOrAfter ( 12 ) ;
370
+ return true ;
378
371
}
379
372
380
373
/**
@@ -710,7 +703,7 @@ protected void registerColumnTypes(TypeContributions typeContributions, ServiceR
710
703
if ( getVersion ().isSameOrAfter ( 21 ) ) {
711
704
ddlTypeRegistry .addDescriptor ( new DdlTypeImpl ( JSON , "json" , this ) );
712
705
}
713
- else if ( getVersion (). isSameOrAfter ( 12 ) ) {
706
+ else {
714
707
ddlTypeRegistry .addDescriptor ( new DdlTypeImpl ( JSON , "blob" , this ) );
715
708
}
716
709
@@ -726,8 +719,7 @@ public TimeZoneSupport getTimeZoneSupport() {
726
719
@ Override
727
720
protected void initDefaultProperties () {
728
721
super .initDefaultProperties ();
729
- getDefaultProperties ().setProperty ( BATCH_VERSIONED_DATA ,
730
- Boolean .toString ( getVersion ().isSameOrAfter ( 12 ) ) );
722
+ getDefaultProperties ().setProperty ( BATCH_VERSIONED_DATA , "true" );
731
723
}
732
724
733
725
@ Override
@@ -741,7 +733,7 @@ public boolean getDefaultUseGetGeneratedKeys() {
741
733
// support the version taking an array of the names of the columns to
742
734
// be returned (via its RETURNING clause). No other driver seems to
743
735
// support this overloaded version.
744
- return getVersion (). isSameOrAfter ( 12 ) ;
736
+ return true ;
745
737
}
746
738
747
739
@ Override
@@ -856,27 +848,25 @@ public void contributeTypes(TypeContributions typeContributions, ServiceRegistry
856
848
typeContributions .contributeJdbcType ( OracleReflectionStructJdbcType .INSTANCE );
857
849
}
858
850
859
- if ( getVersion ().isSameOrAfter ( 12 ) ) {
860
- // account for Oracle's deprecated support for LONGVARBINARY
861
- // prefer BLOB, unless the user explicitly opts out
862
- boolean preferLong = serviceRegistry .getService ( ConfigurationService .class ).getSetting (
863
- PREFER_LONG_RAW ,
864
- StandardConverters .BOOLEAN ,
865
- false
866
- );
851
+ // account for Oracle's deprecated support for LONGVARBINARY
852
+ // prefer BLOB, unless the user explicitly opts out
853
+ boolean preferLong = serviceRegistry .getService ( ConfigurationService .class ).getSetting (
854
+ PREFER_LONG_RAW ,
855
+ StandardConverters .BOOLEAN ,
856
+ false
857
+ );
867
858
868
- BlobJdbcType descriptor = preferLong ?
869
- BlobJdbcType .PRIMITIVE_ARRAY_BINDING :
870
- BlobJdbcType .DEFAULT ;
859
+ BlobJdbcType descriptor = preferLong ?
860
+ BlobJdbcType .PRIMITIVE_ARRAY_BINDING :
861
+ BlobJdbcType .DEFAULT ;
871
862
872
- typeContributions .contributeJdbcType ( descriptor );
863
+ typeContributions .contributeJdbcType ( descriptor );
873
864
874
- if ( getVersion ().isSameOrAfter ( 21 ) ) {
875
- typeContributions .contributeJdbcType ( OracleJsonJdbcType .INSTANCE );
876
- }
877
- else {
878
- typeContributions .contributeJdbcType ( OracleJsonBlobJdbcType .INSTANCE );
879
- }
865
+ if ( getVersion ().isSameOrAfter ( 21 ) ) {
866
+ typeContributions .contributeJdbcType ( OracleJsonJdbcType .INSTANCE );
867
+ }
868
+ else {
869
+ typeContributions .contributeJdbcType ( OracleJsonBlobJdbcType .INSTANCE );
880
870
}
881
871
882
872
if ( OracleJdbcHelper .isUsable ( serviceRegistry ) ) {
@@ -923,9 +913,7 @@ public String getNativeIdentifierGeneratorStrategy() {
923
913
924
914
@ Override
925
915
public IdentityColumnSupport getIdentityColumnSupport () {
926
- return getVersion ().isBefore ( 12 )
927
- ? super .getIdentityColumnSupport ()
928
- : Oracle12cIdentityColumnSupport .INSTANCE ;
916
+ return Oracle12cIdentityColumnSupport .INSTANCE ;
929
917
}
930
918
931
919
@ Override
@@ -1176,13 +1164,13 @@ public String getQueryHintString(String sql, String hints) {
1176
1164
public int getMaxAliasLength () {
1177
1165
// Max identifier length is 30 for pre 12.2 versions, and 128 for 12.2+
1178
1166
// but Hibernate needs to add "uniqueing info" so we account for that
1179
- return getVersion (). isSameOrAfter ( 12 , 2 ) ? 118 : 20 ;
1167
+ return 118 ;
1180
1168
}
1181
1169
1182
1170
@ Override
1183
1171
public int getMaxIdentifierLength () {
1184
1172
// Since 12.2 version, maximum identifier length is 128
1185
- return getVersion (). isSameOrAfter ( 12 , 2 ) ? 128 : 30 ;
1173
+ return 128 ;
1186
1174
}
1187
1175
1188
1176
@ Override
@@ -1230,7 +1218,7 @@ public boolean supportsOffsetInSubquery() {
1230
1218
public boolean supportsFetchClause (FetchClauseType type ) {
1231
1219
// Until 12.2 there was a bug in the Oracle query rewriter causing ORA-00918
1232
1220
// when the query contains duplicate implicit aliases in the select clause
1233
- return getVersion (). isSameOrAfter ( 12 , 2 ) ;
1221
+ return true ;
1234
1222
}
1235
1223
1236
1224
@ Override
@@ -1245,7 +1233,7 @@ public boolean supportsRecursiveCTE() {
1245
1233
1246
1234
@ Override
1247
1235
public boolean supportsLateral () {
1248
- return getVersion (). isSameOrAfter ( 12 , 1 ) ;
1236
+ return true ;
1249
1237
}
1250
1238
1251
1239
@ Override
0 commit comments