-
Notifications
You must be signed in to change notification settings - Fork 707
Spring Data 2026.0 Release Notes
Details
-
Spring Data Build - 4.1
We now support type-safe property paths and property references to remove the need for stringly-typed programming when referring to properties within an entity.
Java variants:
PropertyPath.from("name", Person.class) // existing String-based API
PropertyPath.of(Person::getName) // type-safe property reference expression
PropertyPath.from("address.country", Person.class) // existing nested path API
PropertyPath.of(Person::getAddress).then(Address::getCountry) // type-safe composed path expression
PropertyReference.of(Secret::getSecret)Kotlin variants:
PropertyReference.of(Secret::secret)
PropertyPath.of(Person::address / Address::city)allowing type-safe usage through e.g.:
Sort.by(Person::getFirstName, Person::getLastName)In our efforts to refine @ProjectedPayload experience, we now require projection parameter types to be annotated with @ProjectedPayload.
To ease migration we log any occurence of a non-annotated projection type to provide guidance about types that must be annotated to ensure proper projection functionality.
We plan to remove logging for the 2026.1 (November 2026) release train to conclude our phase out supporting not recommended annotation usage.
@ProjectedPayload
interface AnnotatedInterface { … }
interface ThirdPartyInterface { … }
@Controller
class Controller {
@PostMapping(…)
void supportsAnnotatedType(AnnotatedInterface param) {
// …
}
@PostMapping(…)
void supportsThirdPartyTypes(@ProjectedPayload ThirdPartyInterface param) {
// …
}
@PostMapping(…)
void unsupportedUsage(ThirdPartyInterface param) {
// …
}
}MongoOperations.bulkWrite(…) can be used to issue a single request with mixed insert, update, and delete operations across multiple collections (requires MongoDB 8.0+) or just a single collection. In the latter case the new bulkWrite method can also be used with older MongoDB server versions.
Bulk bulk = Bulk.create(builder -> builder.inCollection(Jedi.class, spec -> spec
.insert(new Jedi("Luke", "Skywalker"))
.insert(new Jedi("Leia", "Princess"))
.updateOne(where("firstname").is("Leia"), new Update().set("lastname", "Organa")))
.inCollection(Sith.class, spec -> spec.upsert(where("name").is("Darth Sidious"), Update.update("realName", "Palpatine")))
);
BulkWriteResult result = operations.bulkWrite(bulk, BulkWriteOptions.ordered());Spring Data Redis now supports annotation-driven Pub/Sub Listener Endpoints built on Spring Messaging. Annotation-driven endpoints are called once a Pub/Sub message is received by a channel or pattern subscription through RedisMessageListenerContainer.
You can activate annotation-driven listener endpoints through @EnableRedisListeners on a configuration class such as shown below:
@Configuration
@EnableRedisListeners
public class RedisConfiguration {
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory connectionFactory) {
RedisMessageListenerContainer factory = new RedisMessageListenerContainer();
factory.setConnectionFactory(connectionFactory);
return factory;
}
}
@Component
public class MyService {
@RedisListener(topic = "my-channel")
public void processOrder(String data) { ... }
}Annotated endpoints can make use of various message converters by specifying a MIME type through @RedisListener(consumes). While Pub/Sub messages themselves do not feature headers, a @RedisListener(consumes) declaration indicates a desired media type.
We now support value-based conditions for SET and DEL enabling compareAndSet(…) and compareAndDelete(…) functionality. With growing command complexity we do not want to introduce additional overloads, instead we provide functional command configuration for set and delete:
valueOps.set(key, newValue, spec -> spec.ifEquals().value(expectedValue).expire(Duration.ofSeconds(10)));
valueOps.set(key, newValue, spec -> spec.ifEquals().digest(expectedHex16Digest).expiration(Expiration.keepTtl()));
redisTemplate.delete(key, it -> it.ifNotEquals().value(value));-
M1 - 13 February 2026
-
M2 - 13 March 2026
-
RC1 - 17 April 2026
-
GA - 15 May 2026
-
OSS Support until: June 2027
-
End of Life: June 2028