-
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
Map receive returned incorrect result #2298
Comments
Hello @feng199464 , In MyBatis, dot is used describe nested objects. Closing as this is a duplicate of #13 . |
|
I think you are now talking about mapping from |
|
Okay, then please create a small demo project like these and share it on your repository. |
CREATE TABLE INSERT INTO |
Ah...you assign an alias that contains a dot. 😅 |
In mybatis, if the field alias has a decimal point, it cannot be resolved if it is returned to the map, but my current business needs to dynamically convert the field row value into field column display, for example: ID | subject | score | name |1 | english | 90 | lucy |2 | math | 90 | lucy |3 | math | 100 | jack |4 | chinese | 85 | tom |
english | math | chinese | name90 | 90 | 0 | lucy0 | 100 | 0 | jack0 | 0 | 85 | tomI drew a watch The above figure shows a row of scores for each user. Now I will dynamically convert the account name value into field display The following figure shows the converted data I can't restrict users from adding special characters "." |
When users add data, they use the date as the name of the course. For example: 7.23 English class |
If you have no control over column aliases, there may be something wrong with your project's design. Anyway, MyBatis is working as designed. |
It's now possible to write a custom Map wrapper that allows keys that contain period (dot) `.` or brackets `[]`. Also, it's now possible to write a custom Map wrapper by extending the built-in `MapWrapper`. Should fix mybatis#13 mybatis#2298 mybatis#3062
Duplicate of #13 |
I called the stored procedure from XML. The result returned by the stored procedure contains special characters. The type received by XML is map. The result I got is incorrect. The "." in the figure below is split
The text was updated successfully, but these errors were encountered: