Closed IamFive closed 8 years ago
if we can have @SqlSource annotation is an option too.
@SqlSource(class=xx, method=xx)
List
You can try to use @Lang
annotation and provide custom LanguageDriver
. See velocity-scripting project for example.
How a java annotation propertity set a generic class,just like:
@InsertProvider(type = BaseSQLProvider<Entity>.class, method = "insertSQL")
@jast90 forget it,
I create another issue before https://github.com/mybatis/mybatis-3/issues/321,
It's due to mybatis3's bug, the location is link in the issue.
Have you checked @abel533 's common mapper ? I cannot read Chinese, but it seems like what you guys are looking for.
Sure, it's a nice common mapper, but it's something like "monkey path", inject map statement which make architecture not so intuitive
@harawata If you want implement common mapper,how you do ?Could you share me you idea?
@jast90 I use mybatis-generator for tables that do not need complex queries.
Anyway, I will look into #321 maybe this weekend.
@harawata Common Mapper is like mybatis-generator, but it generator MappedStatement at the runtime.
By the default, you doesn't need to use JPA.
Hi guys,
The fix for #321 is available in the latest snapshot. Can we close this issue now?
@abel533 Hope the fix helps you improve your common mapper. Nice work! :+1:
ok will check it later
Current SelectProvider support use paramObject as arg and return String as result.
I hope it can support :
Basicly, I want to implement a "common crud" mapper. I hope i can dynamic build sql and control return type for the mapped statement.
The current @SelectProvider is useless to me, I didn't see any advantage to xml defined sql. But if we can get mappedStatement in the sql build process, we can dynamic change the whole statement, like ReturnType.
Code I want to implement: