Hibernate ORM 8.0.0.Beta2
by Steve Ebersole
Hibernate ORM 8.0.0.Beta2 is now available. This release brings stronger
concurrency guarantees, expanded Jakarta Persistence 4 support, and
substantial improvements to migration from legacy XML mappings.
Highlights include:
-
*Locking and concurrency improvements.* Optimistic version checks now
account for database behavior that could previously allow concurrent
changes to go undetected. Version locking is supported for
StatelessSession and EntityAgent, concurrent stateless upserts handle
insert races correctly, and generated mutation SQL consistently includes
tenant identifiers.
-
*Expanded Jakarta Persistence 4 support.* Entity listeners can be
declared at package or module scope, and module descriptors can declare
named queries and other mapping metadata. The new @PostCreate and
@PreClosecallbacks observe the lifecycle of entity manager factories,
entity managers, and entity agents.
-
*Improved XML mapping migration.* HbmXmlTransformer more faithfully
preserves legacy mappings when converting to Hibernate’s extended orm.xml
format, including composite identifiers, inheritance, associations,
collections, and stored procedures.
-
*More convenient configuration and diagnostics.* Typed session and query
options cover filtering, JDBC batch and fetch sizes, query-result caching,
and SQL comments. AdjustableSettings allows selected diagnostic settings
to change at runtime, while @DefaultListSemantics provides package- and
module-level control over default list semantics.
-
*Client enhancement and enhancement SPI changes.* Optional client
enhancement lets direct entity-field access from application classes
participate in lazy loading and dirty tracking. The enhancement SPI now
separates the mapping model, options, and execution environment, with
client enhancement exposed separately from managed-class enhancement.
-
*Clearer extension contracts.* The new @SPI annotation identifies
contracts providers may use, implement, or supply. Dialect extension
contracts have explicit classifications, and the central SQL AST and
translator SPIs are out of incubation. Non-incubating SPI compatibility
expectations apply within an X.Y release family.
-
*Query and persistence fixes.* @SQLRestriction supports additional
entity and association mappings. H2, Oracle, and SQL Server correctly handle
on conflict (...) do nothing with explicit conflict columns. Enhanced
dirty tracking also correctly includes changed scalar values in dynamic
updates when nested embeddables are dirty.
When upgrading, note that Hibernate now uses java.time values directly at
the JDBC boundary by default where supported. OSGi metadata and relocation
POMs under the old org.hibernate group ID are no longer published, and
custom cascade implementations and legacy lock cascading are no longer
supported. Custom property-access, enhancement, and dialect integrations
should review the Migration Guide
<https://docs.hibernate.org/orm/8.0/migration-guide/>.
See What’s New <https://docs.hibernate.org/orm/8.0/whats-new/whats-new.html>
for details and the release report
<https://hibernate.atlassian.net/projects/HHH/versions/39688/tab/release-r...>
for the complete list of resolved issues.
Please try Beta2 with your applications and report any regressions or
migration difficulties through Hibernate Jira
<https://hibernate.atlassian.net/>.
Thanks,
Steve
1 month, 3 weeks