-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
idea about make MBG more pluggable #1073
Comments
@ningpp thanks for the idea. I've had similar ideas too - that the basic generator engine should just drive plugins. And The problem is compatibility. I think making a change like this would break every plugin - and I think there are quite a lot of plugins in use. It would need to be done in a version 2.0 that would break backwards compatibility. I started a rewrite some time ago, but ultimately abandoned it when I started work on MyBatis Dynamic SQL. I'm not sure when or if I will get back to that. If you have thoughts about the difficulties of backwards compatibility, I'm interested to hear them. |
@jeffgbutler yes, backwards compatibility is very important. |
hi @jeffgbutler , i wrote a demo, can you give me some advices? ningpp@50de1a8 what did i do? |
current behavior:
targetRuntime determines what type of IntrospectedTable to create,
IntrospectedTable use generators to gen 'base' files.
eg. when
targetRuntime = MyBatis3DynamicSql
,IntrospectedTableMyBatis3DynamicSqlImpl
use
DynamicSqlMapperGenerator
,DynamicSqlSupportClassGenerator
andDynamicSqlModelGenerator
to gen
XxxModelMapper
XxxModelDynamicSqlSupport
andXxxModel
my idea is treat targetRuntime as an composite plugin
eg. when
targetRuntime = MyBatis3DynamicSql
mbg will useMyBatis3DynamicSqlCompositePlugn
to gen files, it actually use
DynamicSqlMapperGeneratorPlugin
,DynamicSqlSupportClassGeneratorPlugin
andDynamicSqlModelGeneratorPlugin
to gen files.what's next?
IntrospectedTable
no longer need methods such ascalculateGenerators
,getGeneratedJavaFiles
...IntrospectedTable
only store table metadata, Plugins for generate various files.The text was updated successfully, but these errors were encountered: