Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public interface AvailableSettings
* @since 5.3
*/
@Deprecated(since = "7.0", forRemoval = true)
@SuppressWarnings("DeprecatedIsStillUsed")
String DELAY_ENTITY_LOADER_CREATIONS = "hibernate.loader.delay_entity_loader_creations";

/**
Expand Down Expand Up @@ -157,6 +158,7 @@ public interface AvailableSettings
* @deprecated This is no longer useful and will be removed.
*/
@Deprecated(since = "7.0", forRemoval = true)
@SuppressWarnings("DeprecatedIsStillUsed")
String DISCARD_PC_ON_CLOSE = "hibernate.discard_pc_on_close";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ public interface BatchSettings {
* @deprecated Use {@link #BUILDER} instead
*/
@Deprecated(since="6.4")
@SuppressWarnings("DeprecatedIsStillUsed")
String BATCH_STRATEGY = "hibernate.jdbc.factory_class";
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public interface BytecodeSettings {
* See HHH-17643
*/
@Deprecated( forRemoval = true )
@SuppressWarnings("DeprecatedIsStillUsed")
String BYTECODE_PROVIDER = "hibernate.bytecode.provider";

/**
Expand Down
29 changes: 16 additions & 13 deletions hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.hibernate.sql.ast.spi.ParameterMarkerStrategy;

/**
* Settings related to JDBC, Connections, pools, Dialects, etc
* Settings related to JDBC, Connections, pools, Dialects, and so on.
*
* @author Steve Ebersole
*/
Expand Down Expand Up @@ -162,7 +162,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett
/**
* Used in conjunction with {@value #JAKARTA_HBM2DDL_DB_NAME} for the purpose of
* determining the {@link org.hibernate.dialect.Dialect} to use when the name does
* not provide enough detail.
* not provide enough information.
* <p>
* The value is expected to match what would be returned from
* {@link java.sql.DatabaseMetaData#getDatabaseProductVersion()}) for the
Expand All @@ -175,7 +175,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett
/**
* Used in conjunction with {@value #JAKARTA_HBM2DDL_DB_NAME} for the purpose of
* determining the {@link org.hibernate.dialect.Dialect} to use when the name does
* not provide enough detail.
* not provide enough information.
* <p>
* The value is expected to match what would be returned from
* {@link java.sql.DatabaseMetaData#getDatabaseMajorVersion()}) for the underlying
Expand All @@ -188,7 +188,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett
/**
* Used in conjunction with {@value #JAKARTA_HBM2DDL_DB_NAME} for the purpose of
* determining the {@link org.hibernate.dialect.Dialect} to use when the name does
* not provide enough detail.
* not provide enough information.
* <p>
* The value is expected to match what would be returned from
* {@link java.sql.DatabaseMetaData#getDatabaseMinorVersion()}) for the underlying
Expand Down Expand Up @@ -258,7 +258,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett
* The default implementation is not recommended for use in production.
*
* @apiNote The term {@code "class"} appears in the setting name due to legacy reasons;
* however it can accept instances.
* however, it can accept instances.
*/
String CONNECTION_PROVIDER = "hibernate.connection.provider_class";

Expand Down Expand Up @@ -303,14 +303,15 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett

/**
* Indicates that connections obtained from the configured {@link ConnectionProvider} have
* auto-commit already disabled when they are acquired.
* {@linkplain java.sql.Connection#getAutoCommit auto-commit} already disabled when they
* are acquired.
* <p>
* It is inappropriate to set this value to {@code true} when the connections returned by
* the provider do not, in fact, have auto-commit disabled. Doing so may lead to Hibernate
* executing SQL operations outside the scope of any transaction.
*
* @apiNote By default, Hibernate calls {@link java.sql.Connection#setAutoCommit(boolean)}
* on newly-obtained connections. With this setting enabled, that call is skipped, along
* on newly obtained connections. With this setting enabled, that call is skipped, along
* with some other operations, in the interest of performance.
*
* @settingDefault {@code false}
Expand All @@ -332,6 +333,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett
* and {@link org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider}.
*/
@Deprecated(since="7")
@SuppressWarnings("DeprecatedIsStillUsed")
String CONNECTION_PREFIX = "hibernate.connection";

/**
Expand All @@ -340,7 +342,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett
* either:
* <ul>
* <li>an instance of {@code StatementInspector},
* <li>a {@link Class} representing an class that implements {@code StatementInspector}, or
* <li>a {@link Class} representing a class that implements {@code StatementInspector}, or
* <li>the name of a class that implements {@code StatementInspector}.
* </ul>
*
Expand Down Expand Up @@ -423,6 +425,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett
* @deprecated It's not necessary to set this explicitly
*/
@Deprecated(since = "7", forRemoval = true)
@SuppressWarnings("DeprecatedIsStillUsed")
String USE_SCROLLABLE_RESULTSET = "hibernate.jdbc.use_scrollable_resultset";

/**
Expand Down Expand Up @@ -539,12 +542,12 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett
* Whether access to JDBC {@linkplain java.sql.DatabaseMetaData metadata} is allowed during bootstrap.
* <p/>
* Typically, Hibernate accesses this metadata to understand the capabilities of the underlying
* database to help minimize needed configuration. Disabling this access means that only explicit
* settings are used. At a minimum, the Dialect to use must be specified using either the {@value #DIALECT}
* or {@value JdbcSettings#JAKARTA_HBM2DDL_DB_NAME} setting. When the Dialect to use is specified in
* database to help minimize needed configuration. Disabling this access means that only explicit
* settings are used. At a minimum, the Dialect to use must be specified using either the {@value #DIALECT}
* or {@value JdbcSettings#JAKARTA_HBM2DDL_DB_NAME} setting. When the Dialect to use is specified in
* this manner it is generally a good idea to specify the
* {@linkplain JdbcSettings#JAKARTA_HBM2DDL_DB_VERSION database version} as well - Dialects use the version
* to configure themselves.
* {@linkplain JdbcSettings#JAKARTA_HBM2DDL_DB_VERSION database version} as well - Dialects use the
* version to configure themselves.
*
* @apiNote The specified Dialect may also provide defaults into the "explicit" settings.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,6 @@ public interface JpaComplianceSettings {
* @deprecated Prefer {@link #JPA_QUERY_COMPLIANCE}
*/
@Deprecated
@SuppressWarnings("DeprecatedIsStillUsed")
String JPAQL_STRICT_COMPLIANCE= "hibernate.query.jpaql_strict_compliance";
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public interface ManagedBeanSettings {
String DELAY_CDI_ACCESS = "hibernate.delay_cdi_access";

/**
* Controls whether Hibernate can try to create beans other than converters
* and listeners using CDI. Only meaningful when a CDI {@link #BEAN_CONTAINER container}
* Controls whether Hibernate can try to create beans other than converters and
* listeners using CDI. Only meaningful when a CDI {@link #BEAN_CONTAINER container}
* is used.
* <p>
* By default, Hibernate will only attempt to create converter and listener beans using CDI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ public interface MappingSettings {
String XML_FORMAT_MAPPER = "hibernate.type.xml_format_mapper";

/**
* Specifies whether to use the legacy provider specific and non-portable XML format for collections and byte arrays
* for XML serialization/deserialization.
* Specifies whether to use the legacy provider-specific and non-portable XML format for
* collections and byte arrays for XML serialization/deserialization.
* <p>
* {@code false} by default. This property only exists for backwards compatibility.
*
Expand Down Expand Up @@ -355,8 +355,8 @@ public interface MappingSettings {
* The possible options for this setting are enumerated by
* {@link org.hibernate.annotations.TimeZoneStorageType}.
*
* @apiNote For backward compatibility with older versions of Hibernate, set this property to
* {@link org.hibernate.annotations.TimeZoneStorageType#NORMALIZE NORMALIZE}.
* @apiNote For backward compatibility with older versions of Hibernate, set this property
* to {@link org.hibernate.annotations.TimeZoneStorageType#NORMALIZE NORMALIZE}.
*
* @settingDefault {@link org.hibernate.annotations.TimeZoneStorageType#DEFAULT DEFAULT},
* which guarantees that the {@linkplain java.time.OffsetDateTime#toInstant() instant}
Expand All @@ -374,7 +374,7 @@ public interface MappingSettings {
* Used to specify the {@link org.hibernate.boot.model.naming.ImplicitNamingStrategy}
* class to use. The following shortcut names are defined for this setting:
* <ul>
* <li>{@code "default"} and {@code "jpa"} are an abbreviations for
* <li>{@code "default"} and {@code "jpa"} are abbreviations for
* {@link org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl}
* <li>{@code "legacy-jpa"} is an abbreviation for
* {@link org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl}
Expand Down Expand Up @@ -465,7 +465,7 @@ public interface MappingSettings {
* Accepts any of:
* <ul>
* <li>an instance of {@code CollectionClassification}
* <li>the (case insensitive) name of a {@code CollectionClassification} (list e.g.)
* <li>the (case-insensitive) name of a {@code CollectionClassification} (list e.g.)
* <li>a {@link Class} representing either {@link java.util.List} or {@link java.util.Collection}
* </ul>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ public interface SchemaToolingSettings {
String HBM2DDL_AUTO = "hibernate.hbm2ddl.auto";

/**
* For cases where the {@value #JAKARTA_HBM2DDL_SCRIPTS_ACTION} value indicates that schema commands
* should be written to DDL script file, specifies if schema commands should be appended to
* the end of the file rather than written at the beginning of the file.
* For cases where the {@value #JAKARTA_HBM2DDL_SCRIPTS_ACTION} value indicates that schema
* commands should be written to a DDL script file, specifies if schema commands should be
* appended to the end of the file rather than written at the beginning of the file.
* <p>
* Values are: {@code true} for appending schema commands to the end of the file, {@code false}
* for writing schema commands at the beginning.
Expand Down Expand Up @@ -233,9 +233,9 @@ public interface SchemaToolingSettings {

/**
* Used to specify the {@link org.hibernate.tool.schema.spi.SchemaFilterProvider} to be
* used by create, drop, migrate and validate operations on the database schema. A
* used by create, drop, migrate, and validate operations on the database schema. A
* {@code SchemaFilterProvider} provides filters that can be used to limit the scope of
* these operations to specific namespaces, tables and sequences. All objects are
* these operations to specific namespaces, tables, and sequences. All objects are
* included by default.
*
* @since 5.1
Expand Down Expand Up @@ -318,7 +318,7 @@ public interface SchemaToolingSettings {
/**
* Specifies a comma-separated list of extra table types, in addition to the
* default types {@code "TABLE"} and {@code "VIEW"}, to recognize as physical
* tables when performing schema update, creation and validation.
* tables when performing schema update, creation, and validation.
*
* @since 5.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public interface TransactionSettings {
* @settingDefault With Jakarta Persistence bootstrapping, based on the persistence unit's {@link PersistenceUnitInfo#getTransactionType()};
* otherwise {@code jdbc}.
*
* @implSpec With non Jakarta Persistence bootstrapping, Hibernate will use {@code jdbc} as the default which
* will cause problems if the application actually uses JTA-based transactions.
* @implSpec With non-Jakarta Persistence bootstrapping, Hibernate will use {@code jdbc} as the
* default which will cause problems if the application actually uses JTA-based transactions.
*
* @see #JTA_PLATFORM
*
Expand Down Expand Up @@ -152,7 +152,7 @@ public interface TransactionSettings {
* Allows a detached proxy or lazy collection to be fetched even when not
* associated with an open persistence context, by creating a temporary
* persistence context when the proxy or collection is accessed. This
* behavior is not recommended, since it can easily break transaction
* behavior is not recommended since it can easily break transaction
* isolation or lead to data aliasing; it is therefore disabled by default.
*
* @settingDefault {@code false} (disabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
* <tr>
* <td>{@value #VALUE_COLUMN_PARAM}</td>
* <td>{@value #DEF_VALUE_COLUMN}</td>
* <td>The name of column which holds the sequence value for the given segment</td>
* <td>The name of the column which holds the sequence value for the given segment</td>
* </tr>
* </table>
*
Expand Down Expand Up @@ -217,7 +217,7 @@ public void configure(GeneratorCreationContext creationContext, Properties param
SEQUENCE_GENERATOR_LOGGER.forcingTableUse();
}

this.databaseStructure = buildDatabaseStructure(
databaseStructure = buildDatabaseStructure(
identifierType,
parameters,
jdbcEnvironment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@
/**
* An enhanced version of table-based id generation.
* <p>
* Unlike the simplistic legacy one (which was only ever intended for subclassing
* support) we "segment" the table into multiple values. Thus, a single table can
* actually serve as the persistent storage for multiple independent generators. One
* approach would be to segment the values by the name of the entity for which we are
* performing generation, which would mean that we would have a row in the generator
* table for each entity name. Or any configuration really; the setup is very flexible.
* A single table may serve as the persistent storage for multiple independent generators.
* For example, we might segment the generated values by the name of the entity for which
* we are generation ids. This, we would have a row in the generator table for each entity
* name. Other approaches are also possible.
* <p>
* By default, we use a single row for all generators (the {@value #DEF_SEGMENT_VALUE}
* segment). The configuration parameter {@value #CONFIG_PREFER_SEGMENT_PER_ENTITY} can
Expand All @@ -84,7 +82,7 @@
* <tr>
* <td>{@value #VALUE_COLUMN_PARAM}</td>
* <td>{@value #DEF_VALUE_COLUMN}</td>
* <td>The name of column which holds the sequence value for the given segment</td>
* <td>The name of the column which holds the sequence value for the given segment</td>
* </tr>
* <tr>
* <td>{@value #SEGMENT_COLUMN_PARAM}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ public boolean isQuoted() {
}

public void setQuoted(boolean quoted) {
if ( quoted == name.isQuoted() ) {
return;
if ( quoted != name.isQuoted() ) {
name = new Identifier( name.getText(), quoted );
}
this.name = new Identifier( name.getText(), quoted );
}

public void setSchema(String schema) {
Expand Down Expand Up @@ -126,7 +125,9 @@ public int hashCode() {

@Override
public boolean equals(Object object) {
return object != null && object.getClass() == getClass() && equals( (AbstractUserDefinedType) object);
return object != null
&& object.getClass() == getClass()
&& equals( (AbstractUserDefinedType) object );
}

public boolean equals(AbstractUserDefinedType table) {
Expand All @@ -144,22 +145,22 @@ else if ( this == table ) {
}

public String toString() {
final StringBuilder buf = new StringBuilder()
final var string = new StringBuilder()
.append( getClass().getSimpleName() )
.append( '(' );
if ( getCatalog() != null ) {
buf.append( getCatalog() ).append( "." );
string.append( getCatalog() ).append( "." );
}
if ( getSchema() != null ) {
buf.append( getSchema() ).append( "." );
string.append( getSchema() ).append( "." );
}
buf.append( getName() ).append( ')' );
return buf.toString();
string.append( getName() ).append( ')' );
return string.toString();
}

@Override
public String getExportIdentifier() {
final StringBuilder qualifiedName = new StringBuilder();
final var qualifiedName = new StringBuilder();
if ( catalog != null ) {
qualifiedName.append( catalog.render() ).append( '.' );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public SelectablePath getSelectablePath() {
}

private static SelectablePath getSelectablePath(Component component) {
final AggregateColumn aggregateColumn = component.getAggregateColumn();
final AggregateColumn parent = component.getParentAggregateColumn();
final var aggregateColumn = component.getAggregateColumn();
final var parent = component.getParentAggregateColumn();
final String simpleAggregateName = aggregateColumn.getQuotedName();
return parent == null
? new SelectablePath( simpleAggregateName )
Expand All @@ -71,8 +71,8 @@ public String getAggregateReadExpressionTemplate(Dialect dialect) {
}

private static String getAggregateReadExpressionTemplate(Dialect dialect, Component component) {
final AggregateColumn aggregateColumn = component.getAggregateColumn();
final AggregateColumn parent = component.getParentAggregateColumn();
final var aggregateColumn = component.getAggregateColumn();
final var parent = component.getParentAggregateColumn();
final String simpleAggregateName = aggregateColumn.getQuotedName( dialect );
// If the aggregate column is an array, drop the parent read expression, because this is a NestedColumnReference
// and will require special rendering
Expand Down Expand Up @@ -105,8 +105,8 @@ public String getAggregateAssignmentExpressionTemplate(Dialect dialect) {
}

private static String getAggregateAssignmentExpressionTemplate(Dialect dialect, Component component) {
final AggregateColumn aggregateColumn = component.getAggregateColumn();
final AggregateColumn parent = component.getParentAggregateColumn();
final var aggregateColumn = component.getAggregateColumn();
final var parent = component.getParentAggregateColumn();
final String simpleAggregateName = aggregateColumn.getQuotedName( dialect );
return parent == null
? Template.TEMPLATE + "." + simpleAggregateName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Class<?> getElementClass() throws MappingException {
}
else {
try {
return classForName( elementClassName, getBuildingContext().getBootstrapContext() );
return classForName( elementClassName, getBootstrapContext() );
}
catch (ClassLoadingException e) {
throw new MappingException( e );
Expand Down
Loading