-
Notifications
You must be signed in to change notification settings - Fork 4.4k
代码生成器,如果entity设置了 %sDO, 自定义代码也会附上DO,这个类名能修改吗? #6774
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
Comments
不支持,自定义模板的你只能自己处理。 |
关键名字框架自动生成的,我能控制里面不带DO. |
这个配置就是设置entityName名字的,如果你又想指定,那自定义模板取变量或者你在定义的时候customMap中手动去除后缀新增一个模板变量,后续你的自定义模板全部引用新的自定义变量 |
在定义文件中加上处理逻辑 .formatNameFunction(tableInfo -> {return tableInfo.getEntityName();}) |
injectionConfig().beforeOutputFile((tableInfo, customMap) -> {
// 加工处理新名称
var newEntityName = tableInfo.getEntityName();
customMap.put("newEntityName",newEntityName);
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
确认
当前程序版本
3.5.11
问题描述
com.baomidou.mybatisplus.generator.config.po.TableInfo 这个类的name, entityName就会带上DO.
详细堆栈日志
The text was updated successfully, but these errors were encountered: