Replies: 1 comment 2 replies
-
|
Hello @chastro3 , I am pretty sure that the error message mentions the solution:
I am not familiar with Lombok, but there seems to be an experimental feature to achieve this. import org.apache.ibatis.annotations.AutomapConstructor;
...
@AllArgsConstructor(onConstructor_ = @__({@AutomapConstructor}))
That behavior may be what you want, but not necessarily what other people want. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m using Lombok’s @SuperBuilder together with fluent getters to define immutable and inheritance-friendly entity classes.
For example:
Lombok generates two constructors:
When MyBatis performs constructor-based result mapping,
argNameBasedConstructorAutoMapping is enabled and the class 'xxx' has multiple constructors
Expected Behavior
If an entity defines exactly one public constructor,
it would be helpful if MyBatis could automatically choose that constructor when multiple constructors exist.
This would make constructor-based result mapping compatible with immutable, fluent-style entities often generated by Lombok’s @SuperBuilder.
I’m not using record because I sometimes need inheritance, which records do not support.
Beta Was this translation helpful? Give feedback.
All reactions