Skip to content

Spring Data 2025.0 Release Notes

Christoph Strobl edited this page Mar 5, 2025 · 7 revisions

General Themes

  • Vector abstraction to represent AI embeddings

Participating Modules

Details

New and Noteworthy

Spring Data Commons - 3.5

Mark pure Repository SpEL Components for Removal

After introducing support for Value Expressions, we now no longer require components that only support SpEL without following the newly introduced Value Expressions API. Therefore, we’re deprecating QueryMethodEvaluationContextProvider (and its reactive variants), and SpelEvaluator for removal in the next major release.

Please migrate off this API towards their Value Expression replacements.

Vector domain type

A growing number of databases have support for vector data mainly in the form of an array of floating-point numbers or quantized int8 (8-bit-integer). The newly introduced Vector type allows abstracting the underlying values within the domain model to simplify declaration, portability, and default storage options.

class Article {

    Vector embedding;
}

Article article = new Article();
article.setEmbedding(Vector.of(model.getVectorOutput()));

Nullability Constraints on Interface Projections

In environments having nullability constraints enabled, interface based projections will enforce those on exposed getter methods. Instead of returning null for getters marked as non nullable, an exception will be raised.

Spring Data JPA - 3.5

Spring Data Relational - 3.5

Spring Data MongoDB - 4.5

Vector Search support

MongoDB Vector Search uses a $vectorSearch aggregation stage to run queries against specialized indexes that can be created using the new VectorIndex via SearchIndexOperations. The VectorSearchOperation can be part of an aggregation pipeline to do similarity search against vector data.

VectorIndex index = new VectorIndex("vector_index")
  .addVector("embedding"), vector -> vector.dimensions(1536).similarity(COSINE))
  .addFilter("year");

mongoTemplate.searchIndexOps(Movie.class)
  .createIndex(index);

// ...

VectorSearchOperation search = VectorSearchOperation.search("vector_index")
  .path("embedding")
  .vector( ... )
  .numCandidates(150)
  .limit(10)
  .quantization(SCALAR)
  .withSearchScore("score");

AggregationResults<MovieWithSearchScore> results = mongoTemplate
  .aggregate(newAggregation(Movie.class, search), MovieWithSearchScore.class);

Refined Bean Validation Callbacks

We refined our Bean Validation arrangement, moving off Application Events in favor of Entity Callbacks, which are much more predictable from an invocation chain perspective. We introduced ValidatingEntityCallback and ReactiveValidatingEntityCallback for reactive usage and deprecated ValidatingMongoEventListener.

With this change, reactive users can use Bean Validation and participate in a coordinate error signal flow.

Sort Support for replace and update first/one

User running MongoDB 8.0+ can benefit from passing on a potential Sort along with the Query to identify the target document of the replace/update operation.

Spring Data Neo4j - 7.5

Spring Data Elasticsearch - 5.5

Spring Data Couchbase - 5.5

Spring Data for Apache Cassandra - 4.5

Upgrade to Cassandra 5

We’ve upgraded the Cassandra driver to version 4.19 and we’re building against Cassandra 5.0.

Support for Storage-Attached Indexes

Spring Data Cassandra ships with support for Storage-Attached Indexes. Specifically, we provide programmatic interfaces to specify and generate CQL for CREATE INDEX … USING 'sai' and the @SaiIndexed annotation for text and vector index definitions.

Vector Search support

With introducing the Spring Data Vector type, we now allow using vector data types in mapped entities. We support both, Cassandra’s CqlVector and our Vector type to insert and query for vector data. Cassandra uses vectors in queries for similarity and ordering.

@Table
class CommentSearch {

	String comment;

	float similarity;
}

@Table
class Comments {

	@Id UUID id;
	String comment;

	@VectorType(dimensions = 5)
	@SaiIndexed Vector vector;
}

Vector vector = Vector.of(/* from your Embedding */);
Columns columns = Columns.empty().include("comment").select("vector",
		it -> it.similarity(vector).cosine().as("similarity"));
Query query = Query.select(columns).limit(3).sort(VectorSort.ann("vector", vector));

List<CommentSearch> result = template.query(Comments.class).as(CommentSearch.class).matching(query).all();

Spring Data Redis - 3.5

Spring Data KeyValue - 3.5

Support for Not, NotIn, and NotLike query keywords

Map-based repositories now support Not, NotIn, and NotLike keywords when using query derivation.

interface PersonRepository extends Repository<Person, String> {

  Person findByFirstnameNot(String firstname);

  Person findByFirstnameNotLike(String firstname);

  Person findByFirstnameNotIn(List<String> in);
}

Spring Data REST - 4.5

Spring Data LDAP - 3.5

Release Dates

  • M1 - Feb 14, 2025

  • RC - April 11, 2025

  • GA - May 16, 2025

  • OSS Support until: May 2026

  • End of Life: Sept 2027

Clone this wiki locally