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
I am not sure if I understand correctly, but it is already possible to map constructor arguments by name.
Please see #721 and the test in this directory for how it works.
If it is not what you are looking for, please explain the mapping you are trying to achieve using some concrete examples (result set, Java classes, etc.).
It's not supported at the moment, but there might be room for improvement.
Could you create a new issue?
As your proposal does not include 'customizable' part, it is different than this request, I would think.
Object construction in ObjectFactory is not customizable in user side.
Users need all result ret (column name and value) instead of
List<Class<?>> constructorArgTypes, List<Object> constructorArgs
.Background
We want get result by immutable class.
There are few implementations in MyBatis.
Current implementation flow is following.
constructor.getParameterTypes().
rsw.getColumnNames()
If not match parameter order, runtime exception is occurred.
mybatis-3/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
Lines 666 to 674 in 76826c8
There are many cases when database column order changes or constructor parameter order changes.
It is more flexible to create customize point of matching strategy by user.
The text was updated successfully, but these errors were encountered: