-
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
Obtain formal parameter names using Java reflection #549
Comments
That is worth looking indeed. Thank you por pointing @trohovsky ! |
<settings>
<setting name="useActualParamName" value="true" />
</settings> UPDATE : The default value of this option is true, so the above setting is not necessary in most cases. It would be great if you could try the latest SNAPSHOT ! |
…s useful only when the legacy style parameter reference (i.e. #{0}, #{1}, ...) is used.
For anyone that finds this GitHub issue and is using eclipse for development, to enable the "-parameters" options inside eclipse you have to go Was working on jUnit tests for my spring web app where MyBatis was not be able to find my named parameters in the mapper xml file. Then a I finally found this "hidden" checkbox which resolved my issue.. |
…ual names (i.e. the names in the method signature). To use this feature, 1) the project must be compiled in Java 8 with '-parameters' option and 2) 'useActualParamName' must be set to true in MyBatis configuration.
…ion required except ja.
…False is useful only when the legacy style parameter reference (i.e. #{0}, #{1}, ...) is used.
-parameters
option for storing formal parameter names to bytecode was added in Java 8 to javac. It would be nice if formal parameter names in mapper classes were obtained by reflection. So, specifying a parameter name by @param annotation wouldn't be required.Note that other libraries have already started to support this feature, for example Hibernate validator.
The text was updated successfully, but these errors were encountered: