Skip to content

Commit

Permalink
completely remove hibernate.dialect.oracle.prefer_long_raw
Browse files Browse the repository at this point in the history
Looks like this has not worked since probably H 6.0

The issue here is that the test for this feature was one of these tests
written to look at the Hibernate metamodel and not at the actual DDL that
was ultimately generated. This is why I despise "unit" testing instead of
testing actual user-visible functionality.

Anyway this was an undocumented feature so it can just be removed.
  • Loading branch information
gavinking committed Jan 18, 2025
1 parent adf607a commit 688c8b7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ public interface DialectSpecificSettings {
*/
String ORACLE_APPLICATION_CONTINUITY = "hibernate.dialect.oracle.application_continuity";

/**
* Enables the use of the deprecated type {@code LONGVARBINARY} on Oracle instead of {@code BLOB}.
*
* @settingDefault {@code false}
*/
String ORACLE_PREFER_LONG_RAW = "hibernate.dialect.oracle.prefer_long_raw";

/**
* Specifies whether the {@code ansinull} setting is enabled on Sybase.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.hibernate.exception.spi.SQLExceptionConversionDelegate;
import org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor;
import org.hibernate.exception.spi.ViolatedConstraintNameExtractor;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.CheckConstraint;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.hibernate.QueryTimeoutException;
import org.hibernate.boot.model.FunctionContributions;
import org.hibernate.boot.model.TypeContributions;
import org.hibernate.cfg.DialectSpecificSettings;
import org.hibernate.dialect.aggregate.AggregateSupport;
import org.hibernate.dialect.aggregate.OracleAggregateSupport;
import org.hibernate.dialect.function.CommonFunctionFactory;
Expand All @@ -35,8 +34,6 @@
import org.hibernate.dialect.temptable.TemporaryTableKind;
import org.hibernate.dialect.unique.CreateTableUniqueDelegate;
import org.hibernate.dialect.unique.UniqueDelegate;
import org.hibernate.engine.config.spi.ConfigurationService;
import org.hibernate.engine.config.spi.StandardConverters;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
import org.hibernate.engine.jdbc.env.spi.IdentifierHelper;
import org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder;
Expand Down Expand Up @@ -87,7 +84,6 @@
import org.hibernate.type.NullType;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaType;
import org.hibernate.type.descriptor.jdbc.BlobJdbcType;
import org.hibernate.type.descriptor.jdbc.JdbcType;
import org.hibernate.type.descriptor.jdbc.NullJdbcType;
import org.hibernate.type.descriptor.jdbc.ObjectNullAsNullTypeJdbcType;
Expand Down Expand Up @@ -167,16 +163,11 @@ public class OracleDialect extends Dialect {
private static final Pattern SQL_STATEMENT_TYPE_PATTERN =
Pattern.compile( "^(?:/\\*.*?\\*/)?\\s*(select|insert|update|delete)\\s+.*?", CASE_INSENSITIVE );

private static final int PARAM_LIST_SIZE_LIMIT_1000 = 1000;

/** Starting from 23c, 65535 parameters are supported for the IN condition. */
private static final int PARAM_LIST_SIZE_LIMIT_65535 = 65535;

/**
* @deprecated Use {@link DialectSpecificSettings#ORACLE_PREFER_LONG_RAW}.
* Starting from 23c, 65535 parameters are supported for the {@code IN} condition.
*/
@Deprecated(since = "7.0", forRemoval = true)
public static final String PREFER_LONG_RAW = DialectSpecificSettings.ORACLE_PREFER_LONG_RAW;
private static final int PARAM_LIST_SIZE_LIMIT_65535 = 65535;
private static final int PARAM_LIST_SIZE_LIMIT_1000 = 1000;

private static final String yqmSelect =
"(trunc(%2$s, 'MONTH') + numtoyminterval(%1$s, 'MONTH') + (least(extract(day from %2$s), extract(day from last_day(trunc(%2$s, 'MONTH') + numtoyminterval(%1$s, 'MONTH')))) - 1))";
Expand Down Expand Up @@ -987,12 +978,6 @@ public void contributeTypes(TypeContributions typeContributions, ServiceRegistry
typeContributions.contributeJdbcType( OracleReflectionStructJdbcType.INSTANCE );
}

// account for Oracle's deprecated support for LONGVARBINARY
// prefer BLOB, unless the user explicitly opts out
final boolean preferLong = serviceRegistry.requireService( ConfigurationService.class )
.getSetting( PREFER_LONG_RAW, StandardConverters.BOOLEAN, false );
typeContributions.contributeJdbcType( preferLong ? BlobJdbcType.PRIMITIVE_ARRAY_BINDING : BlobJdbcType.DEFAULT );

if ( getVersion().isSameOrAfter( 21 ) ) {
typeContributions.contributeJdbcType( OracleJsonJdbcType.INSTANCE );
typeContributions.contributeJdbcTypeConstructor( OracleJsonArrayJdbcTypeConstructor.NATIVE_INSTANCE );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static OracleServerConfiguration fromDialectResolutionInfo(DialectResolut

private static boolean isExtended(Statement statement) {
try ( final ResultSet resultSet =
statement.executeQuery( "select cast('string' as varchar2(32000)) from dual" ) ) {
statement.executeQuery( "select cast('string' as varchar2(32000)) from dual" ) ) {
resultSet.next();
// succeeded, so MAX_STRING_SIZE == EXTENDED
return true;
Expand Down Expand Up @@ -185,7 +185,7 @@ private static Boolean determineApplicationContinuity(Connection connection, Sta

private static boolean isAutonomous(Statement statement) {
try ( final ResultSet resultSet =
statement.executeQuery( "select sys_context('USERENV','CLOUD_SERVICE') from dual" ) ) {
statement.executeQuery( "select sys_context('USERENV','CLOUD_SERVICE') from dual" ) ) {
return resultSet.next()
&& isAutonomous( resultSet.getString(1) );
}
Expand Down

This file was deleted.

0 comments on commit 688c8b7

Please sign in to comment.