-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.
That is worth looking indeed. Thank you por pointing @trohovsky !
Added a new configuration option useActualParamName.
<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 !
For anyone that finds this GitHub issue and is using eclipse for development, to enable the "-parameters" options inside eclipse you have to go Window > Preferences > Java > Compiler and then under "Classfile Generation" there is a checkbox called "Store information about method parameters (usable via reflection)".
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..
Most helpful comment
For anyone that finds this GitHub issue and is using eclipse for development, to enable the "-parameters" options inside eclipse you have to go
Window > Preferences > Java > Compilerand then under "Classfile Generation" there is a checkbox called "Store information about method parameters (usable via reflection)".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..