Skip to content

Spring Data 2025.1 Release Notes

Mark Paluch edited this page Nov 22, 2024 · 7 revisions

General Themes

  • Upgrade to Spring Framework 7

  • Upgrade to Jakarta EE 11 (JPA 3.2, Servlet 6.1)

  • Upgrade to Kotlin 2.0

  • Strong use of JPQL in JPA

  • Removal of ListenableFuture support

Participating Modules

Details

New and Noteworthy

Spring Data Commons - 4.0

Removal of ListenableFuture support

With Spring Framework removing support for ListenableFuture, we’re removing support for ListenableFuture as well. Please use CompletableFuture when using @Async query methods.

Removal of deprecated API

PersistenceConstructor Migration

  • Removal of @PersistenceConstructor in favor of @PersistenceCreator

  • Removal of Parameter.hasSpelExpression() in favor of hasValueExpression().

  • Removal of PersistentEntity.getPersistenceConstructor() in favor of PersistentEntity.getInstanceCreatorMetadata() and isConstructorArgument(…) in favor of isCreatorArgument(…).

  • Removal of PreferredConstructor.isConstructorParameter(…) isCreatorParameter(…).

  • Removal of MappingInstantiationException.getConstructor(…) in favor of getEntityCreator().

SpEL to Value Expression Migration

  • Removal of DefaultSpELExpressionEvaluator and SpELExpressionEvaluator in favor of ValueExpressionEvaluator.

  • Removal of SpELExpressionParameterValueProvider in favor of ValueExpressionParameterValueProvider.

  • Removal of ValueExpressionParameterValueProvider.potentiallyConvertSpelValue(…) in favor of potentiallyConvertExpressionValue(…).

  • Removed ExtensionAwareQueryMethodEvaluationContextProvider, QueryMethodEvaluationContextProvider and their reactive variants in favor of Value Expression support. QueryMethodValueEvaluationContextAccessor.createEvaluationContextProvider(beanFactory) can help to create default instances.

  • Removed SpelEvaluator and SpelQueryContext in favor of ValueExpressionQueryRewriter

QueryMethod Parameters Revision

  • Removed QueryMethod.createParameters(Method method, TypeInformation<?> domainType) in favor of createParameters(ParametersSource parametersSource)

  • Removal of Parameter(MethodParameter parameter) and Parameters(Method method, Function<MethodParameter, T> parameterFactory).

ClassUtils and ReflectionUtils Revision

  • Removal of CastUtils without replacement. Apply casting where necessary.

  • Removal of org.springframework.data.repository.util.ClassUtils. Several methods went into org.springframework.data.util.ClassUtils and ReflectionUtils.

Other Changes

  • Removal of PersistentPropertyPath.getRequiredLeafProperty() in favor of getLeafProperty().

  • QPageRequest constructors are private now, use of factory methods.

  • Removal of AnnotationRepositoryConfigurationSource constructor

  • Removal of RepositoryFactorySupport.getTargetRepositoryViaReflection(…), use instantiateClass(…) instead.

  • Removed PagedResourcesAssembler.getMethodParameter(…) without replacement

  • Removed org.springframework.data.repository.util.ReactiveWrappers in favor of the variant in the org.springframework.data.util package.

  • ClassTypeInformation was made package-protected. Obtain instances of TypeInformation using the appropriate factory methods on TypeInformation.

  • Removal of the org.springframework.data.type.classreading package in favor of Spring’s AnnotationMetadata.

Spring Data JPA - 4.0

Replace derived CriteriaQuery with String-based queries

15 years ago, Spring Data JPA started to see first light. Back then, it used String-based queries and eventually moved to JPA’s CriteriaQuery API to avoid string concatenation when building queries. It has been quite a ride with the Criteria API being powerful yet restricted as Hibernate was capable of way more functionality than exposed through the Criteria API (e.g. Nulls Precedence when sorting).

A couple years into Criteria API, we started noticing a huge performance penalty using Criteria API. JPA providers have to evaluate the entire query on each query creation whereas Hibernate is able to cache queries much better when using String-based JPQL queries.

We finally decided to explore a JPQL-based approach to derived queries and we found a 3.5x improvement in running such queries. While the factor 3.5x applies to in-memory databases, a typical application can still benefit from a roughly 25% improvement in query throughput by leveraging Hibernate’s query caching.

Using an different API that has proved over 15 years bears quite some risk in breaking applications that otherwise ran fine. We need your feedback to let us know about cases that behave differently in comparison to the previous version.

Spring Data Relational - 4.0

Spring Data MongoDB - 5.0

Spring Data Neo4j - 8.0

Spring Data Elasticsearch - 6.0

Spring Data Couchbase - 6.0

Spring Data for Apache Cassandra - 5.0

Removal of ListenableFuture support

With Spring Framework removing support for ListenableFuture, we’re removing support for ListenableFuture as well. Packages org.springframework.data.cassandra.core.cql.legacy and o.s.d.c.core.legacy are removed. Use asynchronous template API implementations and their utilities from o.s.d.c.core.cql respective o.s.d.c.core.

Spring Data Redis - 4.0

Spring Data KeyValue - 4.0

Spring Data REST - 5.0

Spring Data LDAP - 4.0

Release Dates

  • M1 - January 2025

  • M2 - March 2025

  • M3 - May 2025

  • M4 - July 2025

  • RC1 - Sept 2025

  • RC2 - Oct 2025

  • GA - Nov 2025

  • OSS Support until: May 2025

  • End of Life: Sept 2026

Clone this wiki locally