-
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
Cross-mapper <include> tag resolves to the wrong SQL definition #3246
Comments
Hello @lyw0210 , MyBatis resolves include sequentially when it's nested. So, this is original. <select id="select" resultType="java.util.Map">
select <include refid="test.com.example.MapperB.More_Column_List"/>
</select> First step is obvious. <select id="select" resultType="java.util.Map">
select <include refid="Base_Column_List"/>
</select> In the second step, That example is not realistic, so it's unclear what exactly you want to achieve, but you should use fully-qualified ID or |
@harawata (Sorry, English is not my native language, so there might be some grammatical errors.) |
You English is probably better than mine. :) It does behave consistently. It seems to be the only possible way technically, but even if there is a way to change the behavior, it will break backward compatibility, so we can't/won't change it.
I know. |
My English comes from ChatGPT, haha. XD I now understand that this is the expected behavior of Mybatis, and that’s enough for me. I think I can find a better solution. Thank you for clarifying! |
MyBatis version
3.5.0 and 3.5.16
Database vendor and version
mysql 8.0.29
Test case or example project
MapperA.xml
MapperB.xml
MapperA.class
MapperB.class
Steps to reproduce
run MapperA#select
Expected result
==> Preparing: select 'B'
Actual result
==> Preparing: select 'A'
The text was updated successfully, but these errors were encountered: