Skip to content

Commit fd15ea3

Browse files
committed
remove two deprecated methods from OracleDialect
1 parent bb17026 commit fd15ea3

File tree

1 file changed

+9
-45
lines changed

1 file changed

+9
-45
lines changed

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

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.hibernate.QueryTimeoutException;
2020
import org.hibernate.boot.model.FunctionContributions;
2121
import org.hibernate.boot.model.TypeContributions;
22+
import org.hibernate.cfg.DialectSpecificSettings;
2223
import org.hibernate.dialect.aggregate.AggregateSupport;
2324
import org.hibernate.dialect.aggregate.OracleAggregateSupport;
2425
import org.hibernate.dialect.function.CommonFunctionFactory;
@@ -108,8 +109,6 @@
108109
import static org.hibernate.LockOptions.SKIP_LOCKED;
109110
import static org.hibernate.LockOptions.WAIT_FOREVER;
110111
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;
113112
import static org.hibernate.dialect.OracleJdbcHelper.getArrayJdbcTypeConstructor;
114113
import static org.hibernate.dialect.OracleJdbcHelper.getNestedTableJdbcTypeConstructor;
115114
import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate;
@@ -191,11 +190,10 @@ public class OracleDialect extends Dialect {
191190
@Override
192191
protected void applyAggregateColumnCheck(StringBuilder buf, AggregateColumn aggregateColumn) {
193192
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 );
197196
}
198-
super.applyAggregateColumnCheck( buf, aggregateColumn );
199197
}
200198
};
201199

@@ -239,40 +237,6 @@ public OracleDialect(DialectResolutionInfo info, OracleServerConfiguration serve
239237
this.driverMajorVersion = serverConfiguration.getDriverMajorVersion();
240238
}
241239

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-
276240
public boolean isAutonomous() {
277241
return autonomous;
278242
}
@@ -360,12 +324,12 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
360324
functionFactory.coalesce();
361325

362326
functionContributions.getFunctionRegistry()
363-
.patternDescriptorBuilder( "bitor", "(?1+?2-bitand(?1,?2))")
327+
.patternDescriptorBuilder( "bitor", "(?1+?2-bitand(?1,?2))" )
364328
.setExactArgumentCount( 2 )
365329
.setArgumentTypeResolver( StandardFunctionArgumentTypeResolvers.ARGUMENT_OR_IMPLIED_RESULT_TYPE )
366330
.register();
367331
functionContributions.getFunctionRegistry()
368-
.patternDescriptorBuilder( "bitxor", "(?1+?2-2*bitand(?1,?2))")
332+
.patternDescriptorBuilder( "bitxor", "(?1+?2-2*bitand(?1,?2))" )
369333
.setExactArgumentCount( 2 )
370334
.setArgumentTypeResolver( StandardFunctionArgumentTypeResolvers.ARGUMENT_OR_IMPLIED_RESULT_TYPE )
371335
.register();
@@ -1065,10 +1029,10 @@ public void contributeTypes(TypeContributions typeContributions, ServiceRegistry
10651029
)
10661030
);
10671031

1068-
if(getVersion().isSameOrAfter(23)) {
1032+
if ( getVersion().isSameOrAfter(23) ) {
10691033
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 );
10721036
}
10731037
}
10741038

0 commit comments

Comments
 (0)