This commit is contained in:
Steve Ebersole 2024-03-20 08:56:36 -05:00
parent bcc3ea60de
commit d93bc3c5c8
2 changed files with 54 additions and 1 deletions

View File

@ -234,6 +234,8 @@ public interface MappingSettings {
* {@linkplain java.time.Instant} references, use {@code hibernate.type.preferred_instant_jdbc_type=INSTANT}.
* See {@linkplain #PREFERRED_INSTANT_JDBC_TYPE}, {@linkplain org.hibernate.type.SqlTypes#INSTANT} and
* {@linkplain org.hibernate.type.descriptor.jdbc.InstantJdbcType}.
*
* @settingDefault false
*
* @since 6.5
*/

View File

@ -34,7 +34,7 @@ For 6.5 this behavior is disabled by default. To opt-in,
[source]
----
hibernate.type.prefer_java_type_jdbc_types=false
hibernate.type.prefer_java_type_jdbc_types=true
----
It is expected the default will flip for 7.0.
@ -65,9 +65,60 @@ and associations will be eagerly initialized, so there is no change of behavior
[[ddl-implicit-datatype-enum]]
== Datatype for enums
Hibernate ORM 6.5 now uses the `ENUM` datatype for `@Enumerated(EnumType.STRING)` enumeration mappings by default on H2,
just like link:{docsBase}/6.2/migration-guide/migration-guide.html#ddl-implicit-datatype-enum[ORM 6.2 already started doing for MySQL/MariaDB].
The change is backwards compatible, though schema validation might produce an error now as the expected type is `enum`,
whereas it was `varchar` of `char` before. To revert to the original mapping,
annotate the enum attribute with `@JdbcTypeCode(SqlTypes.VARCHAR)` or `@Column(columnDefinition = "varchar(255)")`.
[[jdbc-metadata-on-boot]]
== hibernate.boot.allow_jdbc_metadata_access
6.5 adds a new setting named `hibernate.boot.allow_jdbc_metadata_access` as a supported replacement for
the legacy `hibernate.temp.use_jdbc_metadata_defaults` setting which was only ever considered internal and
unsupported for use by applications (as should have been obvious from the name).
This setting controls whether Hibernate should be allowed to access the JDBC `DatabaseMetaData` during bootstrapping.
With this setting enabled (the default), Hibernate will access the `DatabaseMetaData` to perform some internal
configuration based on the reported capabilities of the underlying database. Disabling this setting requires
explicit settings for this configuration. At a minimum this includes:
* `hibernate.dialect` or `jakarta.persistence.database-product-name` to indicate the type of database
* `jakarta.persistence.database-product-version` to indicate the database version
[[sql-expectation]]
== SQL Execution Expectation
6.5 moves away from an enumeration approach to specifying the expected outcome of specific SQL executions to
a more flexible approach of directly specifying the `Expectation` implementation to use.
`ExecuteUpdateResultCheckStyle` and `ResultCheckStyle` approaches are still available, though deprecated.
[[uk-naming]]
== Unique Key Naming
Previous 6.x versions did not apply `ImplicitNamingStrategy` when determining the name of a unique key implicitly.
[[annotation-problems]]
== Annotation Problems
6.5 makes various problems in annotations errors (fail fast) as opposed to logged warnings.
[[annotation-processor-rename]]
== Annotation Processor Rename
The name of Hibernate's Annotation Processor has been changed to `org.hibernate.processor.HibernateProcessor`.
This change will not affect most users as such processors are normally discovered from the `javac` "processor path", but is important to know for users using the processor manually.
[[jakarta-data]]
== Jakarta Data
6.5 adds support for the Jakarta Data specification, though this support is considered tech preview as the specification is still being actively developed.