mybatis-3
mybatis-3 copied to clipboard
Want to enhance provider
I like using provider to write SQL so much that there is no mapper.xml in the project , can you consider adding the @prodiver annotation on the mapper interface to bind the prodiversql class and automatically map the methods with matching method names? I think it is very troublesome to write the methods one by one. (#^.^#)
Hello @tanhh326 ,
If I understand you correctly, it is already possible. It's explained in the doc and this test demonstrates the basic and some advanced usages.
There also is a setting defaultSqlProviderType
that allows you to omit type
.
https://mybatis.org/mybatis-3/configuration.html#settings
If it's not what you want, please elaborate.
@harawata Thanks, yes, I downloaded the master version so didn't see it, thank you for answering my stupid question. Is @xxProvider
on a method automatically mapped to a method with the same name and a co-parameter method also supported?
I'm not sure what 'co-parameter method' means. It's difficult to discuss the matter without code. Please create a small project like these and test the behavior yourself. If it didn't work as you expect, share the project on your repo and let us know.
No response. Closing.