DATAJDBC-508 - Add support for @Value in persistence constructors.

We now evaluate @Value annotations in persistence constructors to compute values when creating object instances. AtValue can be used to materialize values for e.g. transient properties. Root properties map to the ResultSet from which an object gets materialized.

class WithAtValue {

	private final @Id Long id;
	private final @Transient String computed;

	public WithAtValue(Long id,
			@Value("#root.first_name") String computed) { // obtain value from first_name column
		this.id = id;
			this.computed = computed;
		}
	}
This commit is contained in:
Mark Paluch
2020-09-22 11:48:56 +02:00
parent 842a309f27
commit 9cd8fc16b3
4 changed files with 198 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ This section covers the significant changes for each version.
== What's New in Spring Data JDBC 2.1
* Dialect for Oracle databases.
* Support for `@Value` in persistence constructors.
[[new-features.2-0-0]]
== What's New in Spring Data JDBC 2.0