|
19 | 19 | import org.hibernate.QueryTimeoutException;
|
20 | 20 | import org.hibernate.boot.model.FunctionContributions;
|
21 | 21 | import org.hibernate.boot.model.TypeContributions;
|
| 22 | +import org.hibernate.cfg.DialectSpecificSettings; |
22 | 23 | import org.hibernate.dialect.aggregate.AggregateSupport;
|
23 | 24 | import org.hibernate.dialect.aggregate.OracleAggregateSupport;
|
24 | 25 | import org.hibernate.dialect.function.CommonFunctionFactory;
|
|
108 | 109 | import static org.hibernate.LockOptions.SKIP_LOCKED;
|
109 | 110 | import static org.hibernate.LockOptions.WAIT_FOREVER;
|
110 | 111 | import static org.hibernate.cfg.AvailableSettings.BATCH_VERSIONED_DATA;
|
111 |
| -import static org.hibernate.cfg.DialectSpecificSettings.ORACLE_EXTENDED_STRING_SIZE; |
112 |
| -import static org.hibernate.cfg.DialectSpecificSettings.ORACLE_AUTONOMOUS_DATABASE; |
113 | 112 | import static org.hibernate.dialect.OracleJdbcHelper.getArrayJdbcTypeConstructor;
|
114 | 113 | import static org.hibernate.dialect.OracleJdbcHelper.getNestedTableJdbcTypeConstructor;
|
115 | 114 | import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate;
|
@@ -191,11 +190,10 @@ public class OracleDialect extends Dialect {
|
191 | 190 | @Override
|
192 | 191 | protected void applyAggregateColumnCheck(StringBuilder buf, AggregateColumn aggregateColumn) {
|
193 | 192 | final JdbcType jdbcType = aggregateColumn.getType().getJdbcType();
|
194 |
| - if ( dialect.getVersion().isBefore( 23, 6 ) && jdbcType.isXml() ) { |
195 |
| - // ORA-00600 when selecting XML columns that have a check constraint was fixed in 23.6 |
196 |
| - return; |
| 193 | + // ORA-00600 when selecting XML columns that have a check constraint was fixed in 23.6 |
| 194 | + if ( !dialect.getVersion().isBefore( 23, 6 ) || !jdbcType.isXml() ) { |
| 195 | + super.applyAggregateColumnCheck( buf, aggregateColumn ); |
197 | 196 | }
|
198 |
| - super.applyAggregateColumnCheck( buf, aggregateColumn ); |
199 | 197 | }
|
200 | 198 | };
|
201 | 199 |
|
@@ -239,40 +237,6 @@ public OracleDialect(DialectResolutionInfo info, OracleServerConfiguration serve
|
239 | 237 | this.driverMajorVersion = serverConfiguration.getDriverMajorVersion();
|
240 | 238 | }
|
241 | 239 |
|
242 |
| - @Deprecated( since = "6.4" ) |
243 |
| - protected static boolean isExtended(DialectResolutionInfo info) { |
244 |
| - final DatabaseMetaData databaseMetaData = info.getDatabaseMetadata(); |
245 |
| - if ( databaseMetaData != null ) { |
246 |
| - try ( java.sql.Statement statement = databaseMetaData.getConnection().createStatement() ) { |
247 |
| - statement.execute( "select cast('string' as varchar2(32000)) from dual" ); |
248 |
| - // succeeded, so MAX_STRING_SIZE == EXTENDED |
249 |
| - return true; |
250 |
| - } |
251 |
| - catch ( SQLException ex ) { |
252 |
| - // failed, so MAX_STRING_SIZE == STANDARD |
253 |
| - // Ignore |
254 |
| - } |
255 |
| - } |
256 |
| - // default to the dialect-specific configuration setting |
257 |
| - return ConfigurationHelper.getBoolean( ORACLE_EXTENDED_STRING_SIZE, info.getConfigurationValues(), false ); |
258 |
| - } |
259 |
| - |
260 |
| - @Deprecated( since = "6.4" ) |
261 |
| - protected static boolean isAutonomous(DialectResolutionInfo info) { |
262 |
| - final DatabaseMetaData databaseMetaData = info.getDatabaseMetadata(); |
263 |
| - if ( databaseMetaData != null ) { |
264 |
| - try ( java.sql.Statement statement = databaseMetaData.getConnection().createStatement() ) { |
265 |
| - return statement.executeQuery( "select 1 from dual where sys_context('USERENV','CLOUD_SERVICE') in ('OLTP','DWCS','JSON')" ) |
266 |
| - .next(); |
267 |
| - } |
268 |
| - catch ( SQLException ex ) { |
269 |
| - // Ignore |
270 |
| - } |
271 |
| - } |
272 |
| - // default to the dialect-specific configuration setting |
273 |
| - return ConfigurationHelper.getBoolean( ORACLE_AUTONOMOUS_DATABASE, info.getConfigurationValues(), false ); |
274 |
| - } |
275 |
| - |
276 | 240 | public boolean isAutonomous() {
|
277 | 241 | return autonomous;
|
278 | 242 | }
|
@@ -360,12 +324,12 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
|
360 | 324 | functionFactory.coalesce();
|
361 | 325 |
|
362 | 326 | functionContributions.getFunctionRegistry()
|
363 |
| - .patternDescriptorBuilder( "bitor", "(?1+?2-bitand(?1,?2))") |
| 327 | + .patternDescriptorBuilder( "bitor", "(?1+?2-bitand(?1,?2))" ) |
364 | 328 | .setExactArgumentCount( 2 )
|
365 | 329 | .setArgumentTypeResolver( StandardFunctionArgumentTypeResolvers.ARGUMENT_OR_IMPLIED_RESULT_TYPE )
|
366 | 330 | .register();
|
367 | 331 | functionContributions.getFunctionRegistry()
|
368 |
| - .patternDescriptorBuilder( "bitxor", "(?1+?2-2*bitand(?1,?2))") |
| 332 | + .patternDescriptorBuilder( "bitxor", "(?1+?2-2*bitand(?1,?2))" ) |
369 | 333 | .setExactArgumentCount( 2 )
|
370 | 334 | .setArgumentTypeResolver( StandardFunctionArgumentTypeResolvers.ARGUMENT_OR_IMPLIED_RESULT_TYPE )
|
371 | 335 | .register();
|
@@ -1065,10 +1029,10 @@ public void contributeTypes(TypeContributions typeContributions, ServiceRegistry
|
1065 | 1029 | )
|
1066 | 1030 | );
|
1067 | 1031 |
|
1068 |
| - if(getVersion().isSameOrAfter(23)) { |
| 1032 | + if ( getVersion().isSameOrAfter(23) ) { |
1069 | 1033 | final JdbcTypeRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration().getJdbcTypeRegistry();
|
1070 |
| - jdbcTypeRegistry.addDescriptor(OracleEnumJdbcType.INSTANCE); |
1071 |
| - jdbcTypeRegistry.addDescriptor(OracleOrdinalEnumJdbcType.INSTANCE); |
| 1034 | + jdbcTypeRegistry.addDescriptor( OracleEnumJdbcType.INSTANCE ); |
| 1035 | + jdbcTypeRegistry.addDescriptor( OracleOrdinalEnumJdbcType.INSTANCE ); |
1072 | 1036 | }
|
1073 | 1037 | }
|
1074 | 1038 |
|
|
0 commit comments