Skip to content
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

目前mapper文件的表名是写死的,变成动态的可设置的是否更灵活 #6

Closed
DaredevilDA opened this issue Nov 28, 2018 · 2 comments

Comments

@DaredevilDA
Copy link

DaredevilDA commented Nov 28, 2018

只需引jar,前缀可设置,并创建带特定前缀的数据库即可,不需重复打包,更改mapper中表名。

目前我这里实现为:
persistModule 增加 配置
所有以DO和DOExample结尾的类继承抽象类,抽象类包含属性 tableNamePrefix

在所有设置上述两种类的地方增加设置setTableNamePrefix(PersistModule.getInstance().getTableNamePrefix())

在所有mapper里 将原表名替换为 ${tableNamePrefix}bulbasaur_X

@fromcth
Copy link
Contributor

fromcth commented Mar 12, 2019

mapper里 将

目前项目里面是可以用户传入表的,在配置初始化xml时候指定

image

@fromcth fromcth closed this as completed Mar 12, 2019
@DaredevilDA
Copy link
Author

DaredevilDA commented Mar 12, 2019

目前项目里面是可以用户传入表的,在配置初始化xml时候指定

不清楚这个设计理念要不要支持如下场景:
如果几个小组用一套封好的jar,但是连接的是同一个数据库,组内之间用表名前缀区分业务呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants