mybatis-3 icon indicating copy to clipboard operation
mybatis-3 copied to clipboard

Want to enhance provider

Open tanhh326 opened this issue 2 years ago • 3 comments

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. (#^.^#)

tanhh326 avatar Jun 18 '22 15:06 tanhh326

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 avatar Jun 24 '22 01:06 harawata

@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?

tanhh326 avatar Jun 24 '22 02:06 tanhh326

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.

harawata avatar Jun 24 '22 02:06 harawata

No response. Closing.

harawata avatar Mar 08 '23 22:03 harawata