idea生成mysql表_better-mybatis-generator

better-mybatis-generator idea plugin

插件功能:在idea的database工具中使用,选择表(一或n,建议n小于10),生成mybatis相关的代码,(包括:dao、example、domain、xml)。

Use in idea database tool,right click table(one or more) to generate mybatis files (include:dao、example、domain、xml).

Plugin Installation:

在idea插件系统里安装 | Using IDE built-in plugin system on Windows:

File > Settings > Plugins > Browse repositories... > Search for "better-mybatis-generator" > Install Plugin

手动zip安装 | Manually:

Download the latest release and install it manually using Preferences > Plugins > Install plugin from disk...

Using sample screenshots:

#1、设置自定义默认配置,若不设置,则使用程序默认配置。 | Set custom default configuration,If not, use the program default configuration.

1.png

#2、配置数据库 | Connecting to Your Database.

2.png

3.png

4.png

#3、在需要生成代码的表上右键,选择mybatis generate,打开预览界面。 | Select one or more tables,right click and select mybatis generate to open generatoe main UI.

5.png

#4、设置确认完成后,点击ok,开始生产代码。 | Check configuration in main ui,click ok.

6.png

#5、首次使用此插件,需要为插件提供数据库账号密码。 | Provide account and password for the first time.

7.png

#6、检查生成的代码文件 | Generate work finish,Check your files.

8.png

如何在本地运行/调试此插件 | How to run/debug plugin :

#1、创建工程 File -> New -> Project from Version Control -> Git 填写github地址:https://github.com/kmaster/better-mybatis-generator.git

%E4%BB%8Egithub%E5%88%9B%E5%BB%BA%E5%B7%A5%E7%A8%8B.png

#2、修改sdk

%E4%BF%AE%E6%94%B9%E6%8F%92%E4%BB%B6sdk.png

#3、运行配置无误则直接run/debug。若因idea版本导致提供的配置不对,请考虑本地创建空的插件工程然后参考其配置。

run.png

此时打上断点就可以一步步调试,修改代码后点击 Build->prepare plugin modle "xxx" For Deployment生成插件安装包再本地安装使用,

如果想优化此插件代码,比如其他数据库或运行环境,可以修改后在github上发起pull request。能点个star就更好了,哈哈。

注意事项 | notice:

#1、当数据库用mysql8,在URL上定义时区,推荐使用'?serverTimezone=GMT',配置中勾选上mysql8选项。 | If your database is mysql8,please add '?serverTimezone=GMT' and select mysql8 option

mysql8-config.png

mysql%E9%80%89%E9%A1%B9.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值