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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user