Updated Spring Framework 7.0 Release Notes (markdown)

master
Juergen Hoeller 2 months ago
parent
commit
7648247a15
  1. 16
      Spring-Framework-7.0-Release-Notes.md

16
Spring-Framework-7.0-Release-Notes.md

@ -11,7 +11,7 @@ Specifically, this new generation raises its minimum requirements for the follow @@ -11,7 +11,7 @@ Specifically, this new generation raises its minimum requirements for the follow
* Servlet 6.1 (Tomcat 11.0, Jetty 12.1)
* JPA 3.2 (Hibernate ORM 7.1/7.2)
* Bean Validation 3.1 (Hibernate Validator 9.0)
* Bean Validation 3.1 (Hibernate Validator 9.0/9.1)
* GraalVM 25 with the [new "exact reachability metadata" format](https://www.graalvm.org/latest/reference-manual/native-image/metadata/)
* Netty 4.2 (see [#34996](https://github.com/spring-projects/spring-framework/pull/34996))
* Kotlin 2.2 (see [#33629](https://github.com/spring-projects/spring-framework/issues/33629))
@ -87,13 +87,11 @@ JPA 3.2 introduces a new arrangement for dependency injection: An `EntityManager @@ -87,13 +87,11 @@ JPA 3.2 introduces a new arrangement for dependency injection: An `EntityManager
Spring Framework 7.0 also embraces Hibernate ORM 7.1/7.2 as a JPA provider, with the native Hibernate support formerly living in `org.springframework.orm.hibernate5` having migrated to the `orm.jpa.hibernate` package. Note that only the capabilities that make sense in addition to JPA itself are being continued: `LocalSessionFactoryBean/Builder`, `HibernateTransactionManager`, `SpringBeanContainer`, `SpringSessionContext`. This serves as an alternative to standard JPA bootstrapping and is also able to support `SessionFactory#getCurrentSession()` based data access code.
Furthermore, `LocalSessionFactoryBean` also exposes transactional `Session` and `StatelessSession` proxy references for dependency injection, along the lines of the JPA 3.2 arrangement above. We recommend using Hibernate ORM 7.2 (rather than 7.1) for `StatelessSession` support since we can derive a transactional `StatelessSession` from the current transactional `Session` there.
### Persistence unit management for JPA 3.2/4.0
### JPA persistence unit configuration
For a warning-free experience with JPA 3.2 and forward compatibility with JPA 4.0, Spring's `MutablePersistenceUnitInfo` is decoupled from the standard `PersistenceUnitInfo` interface itself now. `MutablePersistenceUnitInfo` was originally designed as the argument type for `PersistenceUnitPostProcessor` and now exclusively serves that purpose; it cannot be assigned to `jakarta.persistence.spi.PersistenceUnitInfo` since it does not implement that interface directly anymore.
For a warning-free experience with JPA 3.2 and forward compatibility with JPA 4.0, Spring's `MutablePersistenceUnitInfo` is decoupled from the standard `PersistenceUnitInfo` interface itself now. `MutablePersistenceUnitInfo` was originally designed as the argument type for `PersistenceUnitPostProcessor` and now exclusively serves that purpose; it cannot be assigned to `jakarta.persistence.spi.PersistenceUnitInfo` since it does not implement that interface directly anymore. For any custom bootstrapping purposes, use the newly public `SpringPersistenceUnitInfo` class instead, adapting it to `jakarta.persistence.spi.PersistenceUnitInfo` through `SpringPersistenceUnitInfo#asStandardPersistenceUnitInfo()` (which automatically adapts to the JPA 3.2/4.0 API as encountered at runtime).
Additionally, `LocalEntityManagerFactoryBean` accepts a JPA 3.2 `PersistenceConfiguration` object now, for richer standalone bootstrapping without `persistence.xml`. `LocalContainerEntityManagerFactoryBean` accepts `PersistenceConfiguration` as well, merging it into its default persistence unit. This specifically supports the `HibernatePersistenceConfiguration` subclass as well, detecting Hibernate ORM 7.1's scanning configuration options.
For any custom bootstrapping purposes, use the newly public `SpringPersistenceUnitInfo` class instead, adapting it to `jakarta.persistence.spi.PersistenceUnitInfo` through `SpringPersistenceUnitInfo#asStandardPersistenceUnitInfo()` - which automatically adapts to the JPA 3.2/4.0 API as encountered at runtime. We aim to provide early support for JPA 4.0 providers in Spring Framework 7.1, without any changes to your Spring configuration.
### JMS destination handling
@ -188,6 +186,12 @@ Aligned with `core.retry`, there is also `@Retryable` annotation support in the @@ -188,6 +186,12 @@ Aligned with `core.retry`, there is also `@Retryable` annotation support in the
Note that `@Retryable` (including its customization through annotation attributes) automatically adapts to reactive methods with a reactive return type, decorating the pipeline with Reactor’s retry capabilities. Regular imperative methods will be invoked via a `RetryTemplate` with a corresponding `RetryPolicy`.
### Embracing JPA 3.2 and Hibernate `StatelessSession`
`LocalEntityManagerFactoryBean` accepts a JPA 3.2 `PersistenceConfiguration` object now, for richer standalone bootstrapping without `persistence.xml`. `LocalContainerEntityManagerFactoryBean` accepts `PersistenceConfiguration` as well, merging it into its default persistence unit. This specifically supports the `HibernatePersistenceConfiguration` subclass as well, detecting Hibernate ORM 7.1's scanning configuration options.
`LocalSessionFactoryBean` exposes transactional `Session` and `StatelessSession` proxy references for dependency injection, along the lines of the JPA 3.2 arrangement for `EntityManager` injection with `@Inject`/`@Autowired`. We recommend using Hibernate ORM 7.2 (rather than 7.1) for `StatelessSession` support since we can derive a transactional `StatelessSession` from the current transactional `Session` there.
### Introducing `JmsClient` and revisiting `JdbcClient`
After `JdbcClient` and `RestClient` in 6.1, Spring Framework 7.0 introduces a `JmsClient` now: with common send and receive operations against a JMS destination, dealing with Spring's common `Message` or with payload values, throwing `MessagingException` in alignment with the `spring-messaging` module. This is effectively an alternative to `JmsMessagingTemplate`, also delegating to Spring's `JmsTemplate` for performing actual operations.

Loading…
Cancel
Save