mybatis-3
mybatis-3 copied to clipboard
Allow custom mapper methods to initiate dynamic injection
This dynamic injection method is the core principle of mybatis-plus, and we hope that the official mybatis can adopt it, Thank you for checking
@harawata Thoughts? Looks ok to me.
coverage: 87.178% (+0.03%) from 87.153% when pulling 0e883d6afaf37a12a6ba2040904493cfaa1c0c3f on baomidou:master into c3fd28c24fd160b9fc18b8c6b9033b2cbd461a50 on mybatis:master.
Adding a mapper method at runtime is not a good idea. If you want to generate SQL dynamically, please use SQL provider.
Adding a mapper method at runtime is not a good idea. If you want to generate SQL dynamically, please use SQL provider.
hi @harawata The injection method provided by PR is an XML simulation injection method, which has more secure SQL protection, Performance may be better in ordinary simple crud situations,Every time the SQL Provider method is called, the SQL statement is regenerated, which may result in additional parsing time, especially for complex SQL generation logic. I hope to carefully consider my suggestion and provide an additional injection solution, which is not a bad thing for MyBatis itself. Thank you for your reply
I'm sorry, but I still think this is a bad idea.