Open sunny-chung opened 11 months ago
Constructor arguments map to properties and @Transient
is applied from the property declaration. Let me take your request to the team.
We consider adding support for @Transient
properties in constructors. Record components could also be annotated with the @Transient
annotation to allow record construction. While this can be useful, we recommend using the @Value
annotation to use SpEL expressions to determine a useful value.
This is a feature request. Currently querying an entity like this would fail:
with exception:
Although there are many workarounds, it would be better if fields marked
@Transient
and have a default value in the constructor could be "ignored", so that we do not have to add another constructor to handle this use case.