You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After debugging the issue, I found that when creating the entity without using the default constructor, no additional actions are performed, such as injecting null values or default values, into fields annotated with @Transient.
Therefore, this issue does not occur only with records, but also with classes that only have a constructor that takes a field annotated with @Transient as an argument.
If this is supported, I believe it could be useful with compact constructor of Record.
So, I was wondering if this behavior is intentional or if not, there are any plans to support it.
Additionally, I would like to know if I can contribute to fixing this issue. If so, could you provide me with some guidance on which packages or classes I should check and modify?
The text was updated successfully, but these errors were encountered:
seminchoi
changed the title
@Table Class supports Record (or AllArgsConstructor), but does not support @Transient.
@Table class supports Record (or AllArgsConstructor), but does not support using it with @Transient.
Mar 16, 2025
Spring Data must summon a value for isNew from somewhere and so you cannot just use a full constructor. Please use one without the isNew argument and annotate it with @PersistenceCreator if you have more than one constructor.
When using
Persistable
with a record class in an R2DBC Data Repository, I found that the record does not work properly with the@Transient
annotation.Here is a sample code:
And the test code:
Running this test produces the following error:
After debugging the issue, I found that when creating the entity without using the default constructor, no additional actions are performed, such as injecting null values or default values, into fields annotated with
@Transient
.Therefore, this issue does not occur only with records, but also with classes that only have a constructor that takes a field annotated with
@Transient
as an argument.The issue can be reproduced at https://github.com/seminchoi/r2dbc-transient-issue
If this is supported, I believe it could be useful with compact constructor of Record.
So, I was wondering if this behavior is intentional or if not, there are any plans to support it.
Additionally, I would like to know if I can contribute to fixing this issue. If so, could you provide me with some guidance on which packages or classes I should check and modify?
The text was updated successfully, but these errors were encountered: