Skip to content

Spring Data 2023.1 (Vaughan) Release Notes

Mark Paluch edited this page Jun 13, 2023 · 14 revisions

General Themes

  • Virtual Thread usage through Executor configuration

  • Java 21 Compatibility

  • Support for Kotlin Inline Classes

Participating Modules

Details

New and Noteworthy

Spring Data Commons - 3.2

Spring Data JPA - 3.2

Spring Data Relational - 3.2

Liquibase ChangeSet Writer

When working with SQL databases, the schema is an essential part. Spring Data JDBC supports a wide range of schema options yet when starting with a domain model it can take time to come up with an initial domain model. To help you with a code-first approach, Spring Data JDBC ships with an integration to create database changesets using Liquibase.

LiquibaseChangeSetWriter is the core class to create change sets. The writer can operate in two modes:

  • Initial Schema Creation (without an existing database)

  • Differential Schema Migration (against a database connected via JDBC).

Consider the following example:

H2Database h2Database = new H2Database();
h2Database.setConnection(new JdbcConnection(c));

File changelogYml = new File(new File("my/directory"), "changelog.yml");

LiquibaseChangeSetWriter writer = new LiquibaseChangeSetWriter(relationalMappingContext);
writer.writeChangeSet(new FileSystemResource(changelogYml));

LiquibaseChangeSetWriter inspects all known entities in the RelationalMappingContext and writes a changeset to an existing (or new) changelog file.

SpEL support though @Table and @Column annotations

Mapping annotations for the table and column name respective mapped collections now accept SpEL expressions to determine table and column names at runtime using expressions.

@Table("#{myTenantController.getPersonTableName()}")
static class Person {
    @Id
    @Column("#{myTenantController.getIdentifierColumnName()}") Long id;
}

Expression evaluation leverages Spring Data’s EvaluationContextExtension mechanism in which extension beans can contribute SpEL functionality. Note that expression results are used as table/column names. These are sanitized through a default SqlIdentifierSanitizer.words(), allowing characters and underscores to limit impact of unwanted SQL characters. A different sanitizer can be configured through RelationalMappingContext.

Spring Data MongoDB - 4.2

Spring Data Neo4j - 7.2

Spring Data Elasticsearch - 5.2

Spring Data Couchbase - 5.2

Spring Data for Apache Cassandra - 4.2

Spring Data Redis - 3.2

Spring Data KeyValue - 3.2

Spring Data REST - 4.2

Spring Data LDAP - 3.2

Release Dates

  • M1 - Jul 14, 2023

  • M2 - Aug 18, 2023

  • M3 - Sept 15, 2023

  • RC1 - Oct 13, 2023

  • GA - Nov 17, 2023

  • OSS Support until: Nov 17, 2024

  • End of Life: Feb 17 2025

Clone this wiki locally