-
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
Constructor auto mapping could fail when columnPrefix is specified in the parent resultMap #1495
Comments
Thank you for the report & repro, @hiirage ! There seems to be a few issues indeed and I will try to fix them, but you should know that columnPrefix is not used in constructor auto-mapping. In your demo, for example, Personally, I recommend explicit mapping for constructor. |
@hiirage , Both this issue and #1496 should be fixed in the latest 3.5.1-SNAPSHOT. p.s. |
That’s a known issue @harawata. I thought we talked about it last time. I can’t remember if we had said it was necessary for that 2nd level mapping for some reason. |
Thank you for the comment, @h3adache ! |
MyBatis version
3.5.0
Database vendor and version
H2
Test case or example project
contructor_mapping.zip
Steps to reproduce
Run FooMapperTest to find one object Foo with an immutable Bar from DB
Expected result
get a Foo with a Bar constructed by autoMapping with columnPrefix "b_"
Actual result
An exception thrown with message:
...JdbcSQLSyntaxErrorException: Column "b_B_STR" not found ...
The text was updated successfully, but these errors were encountered: