-
Notifications
You must be signed in to change notification settings - Fork 36
#set inside #repeat does not work correctly #14
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
Comments
Velocity vars like $foo and mybatis binding parameters like @{foo} has different scopes, so in this case @{foo} are always pointing to the last assigned value of $foo. @{foo} knows nothing about the iteration state. In the current implementation, velocity runs before binding, in different phases, so it is not possible or at least not easy nor efficient way to support this requirement without a major refactoring. |
Well, I understand this. But this limits usages a lot. I've got a question: why do you use this approach? As for me, using #p($foo) instead of @{foo) is a little more verbose, but much more flexible. |
@emacarron This is a very old issue. Its root are in mybatis core because scripting evaluation and jdbc parameter binding are handled in different phases. I remember we have discussed this some years ago... Do you think it is time to address this or we will keep current mybatis way forever? |
Should fix mybatis#14 and mybatis#15
Should fix mybatis#14 and mybatis#15
Mapper:
Test:
Exception:
The text was updated successfully, but these errors were encountered: