-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to force a no-argument constructor #2276
Comments
Hello @junglechange , Sorry, I couldn't understand what you mean. |
If you are trying to make it always use the no arg constructor then use the AutomapConstructor annotation. Or simply do not use constructor mapping. |
create table user
call UserMapper.findAll Expected result[User{info=null, name='hello'}] Actual result[User{info='hello', name='hello'}] |
Your Any of the following should resolve your problem.
There also is an ongoing discussion about an enhancement to use argument names for mapping. |
No response. Closing. |
When the order of the sql statement columns and the parameter list of the constructor are not the same, it is easy to make mistakes with the parameter constructor
mybatis-3/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
Line 720 in 7f78398
The text was updated successfully, but these errors were encountered: