Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

surfsun/better-mybatis-generator

Repository files navigation

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.
image

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

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

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

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

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

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

#1、创建工程 File -> New -> Project from Version Control -> Git 填写github地址:https://github.com/kmaster/better-mybatis-generator.git
image
#2、修改sdk image
#3、运行配置无误则直接run/debug。若因idea版本导致提供的配置不对,请考虑本地创建空的插件工程然后参考其配置。
image
此时打上断点就可以一步步调试,修改代码后点击 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
image
image

About

在idea的数据库工具中,直接对表生成mybatis相关的代码文件。

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /