GithubHelp home page GithubHelp logo

spawpaw / mybatis-generator-gui-extension Goto Github PK

View Code? Open in Web Editor NEW
637.0 55.0 235.0 9.39 MB

图形化MBG,内置丰富插件,可生成Service、Controller、View,配置简单。 A powerful GUI tool for MyBatisGenerator(MBG)

License: Other

Java 93.19% CSS 6.81%
mybatis-generator mybatis-generator-gui mybatis-plugin mbg-gui mbg mybatis-generator-noxml mybatis

mybatis-generator-gui-extension's People

Contributors

chenwenhang avatar dependabot[bot] avatar pointroyal avatar spawpaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mybatis-generator-gui-extension's Issues

建议一些优化项

rootClass 属性

还有就是自定义查询方法的问题,作者有什么好的解决方案不?

功能建议

I'm submitting a...

  • Feature request (功能建议)

Expected behavior

1、建议能批量生成,选择需要的表
2、顺便生成service、serviceImpl、dao、daoImpl
生成的entity 上面的注释可以取数据库里面的注释
3、去掉example类
4、生成的xml里面包含常用的查询,以及包含where 那一大堆条件查询

CLIENT_PLUGIN_AUTH is required

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

java版本1.8.0_121
mysql版本5.5.6
错误信息:java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

Others:

生成的XML Mapper文件内有重复元素

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

不选【启用注释插件】或【是否在注释中添加'@mbg.generated'】时,生成的XML Mapper文件内有重复元素

Expected behavior

生成的XML Mapper文件内无重复元素

Minimal reproduction of the problem with instructions

  1. 其它输入流程略;
  2. 反选【启用注释插件】或【是否在注释中添加'@mbg.generated'】;
  3. 点击【生成代码】

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

Others:

tableAlias设置不生效

com/spawpaw/mybatis/generator/gui/util/MBGRunner.java
164行的代码不生效:
Optional.of(projectConfig.tableAlias).filter(notEmptyStringPropertyPredicate)
.ifPresent((tableAlias) -> tableConfiguration.addProperty("alias", projectConfig.tableAlias.getValue()));

改为以下代码方可生成带别名的xml:
/* 设置表别名alias */
Optional.of(projectConfig.tableAlias).filter(notEmptyStringPropertyPredicate)
.ifPresent((tableAlias) -> tableConfiguration.setAlias(projectConfig.tableAlias.getValue()));

mapper接口和 map.xml Example 相关的信息能不能去掉

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

mapper 接口和 mapper.xml 里生成了太多的EXample 相关的信息,其实,在开发中用不到,想让接口和mapper.xml 精简写

Expected behavior

期望增加 是否启用Example 相关信息的配置

Minimal reproduction of the problem with instructions

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

Others:

Mysql 8.0 无法使用

I'm submitting a...

  • [ √] Bug report (BUG 报告)

BUG

使用mysql8.0的时候无法连接,需要在url上加上timezone才能够连接上,但是连接上以后无法获取到表列表,双击左边数据库连接报错如下:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'HAVING TABLE_TYPE IN ('TABLE','VIEW',null,null,null) ORDER BY TABLE_TYPE, TABLE_' at line 1

添加 lombok.Data 功能

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Expected behavior

在实体设置里面添加一项,使用“lombok.Data”
代码能简洁很多

作者,请问可以把界面设计的稍微紧凑一些和简化一下操作吗?

希望作者可以把操作界面稍微简化紧凑一点,

项目功能已经非常丰富,希望作者可以简化一下冗余操作,这样使用起来会更加爽一些

比如这位作者的项目 https://github.com/zouzg/mybatis-generator-gui ,打开后操作界面一目了然,可勾选的可实现的功能都知道有什么,如果功能之间上下间隔太宽的话有的时候会被使用者下意识的被忽略掉,需要增加些时间去了解。
1569892359(1)

自定义列属性

image

active在数据库中是tinyint,显示什么BIT,我就改成Integer了

image

有两个需要改的,但是改下一个的时候之前那个就消失了

然后只改一个生成后的DO类也没有变,还是Boolean

image

字段重复

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

Others:
生成的字段与数据库中实际字段不一致。。会混入别的表中的部分字段
选择自定义字段后 发现单张表中的字段会多次重复

Add code generator for other files ( according to table's remarks )

I'm submitting a...

  • Feature request (功能建议)

Expected behavior

增加代码生成的模块。

工作流: 表/字段注释 -> 配置信息-> 模板获取配置信息并生成代码

例子

一、表/字段注释

在数据库中表/字段的注释中添加#config()形式的注释,例如user表中username字段的注释如下:

用户名
#label(用户名)
#search(equals,like,between,less,larger)

password字段的注释如下:

密码
#hide()

二、展开配置信息

代码生成插件将会将上一步的注释展开到一个map中,例如username字段注释中的信息将会产生如下键值对:

key value
label 用户名
label.用户名 ""
search equals,like,between,less,larger
search.equals ""
search.like ""
search.between ""
search.less ""
search.larger ""

三、模板获取值并生成代码

将上一步中展开的配置注入模板引擎,开始生成代码,下面是示例的模板:

<table>
    <tr>
        #foreach ($column in $table.columns)
            #if(!column.contains("hide"))
                <th>$!{column.get("label")}</th>
        #end
    </tr>
</table>

然后模板引擎便会生成一个带表头信息的表格(不包含密码字段)

提供的仅为一个最简单的例子,事实上通过这种方式可以生成任何形式的代码。
例如第一步中的search,可以选择是否为该字段开启全文搜索、模糊搜索、区间搜索等

考虑附加功能: 在表中的注释默认继承到字段中

关闭连接后无法再连接

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

右键关闭连接后,再想连接,无反应

Expected behavior

希望能关闭后重新连接

Minimal reproduction of the problem with instructions

关闭后再连接即可复现。
关闭后无法连接时,选择编辑连接,并保存,然后重连,就很正常

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others
    mysql
    Others:

exe 可执行程序

I'm submitting a...

  • Feature request (功能建议)

Expected behavior

有没有windows 可执行程序 .exe

There is no file named CommonResponse?

I'm submitting a...

  • Bug report (BUG 报告)

Current behavior

releases : gui-extension-for-mbg-v2.5.6-jar-with-dependencies.jar
MVC generator did not generate a file named CommonResponse

Environment

JDK Version:

  • OracleJDK 8u40+

Database:

  • MySQL/MariaDB
    Others:
    Thank for your development

mybatis 3.5.0 insertBatch 回调 id 的问题

I'm submitting a...

  • Feature request (功能建议)
    mybatis 3.5.0 之前的 insertBatch sql 生成,会出现 回调 id 的问题,官网通过 指定版本来解决



Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

表配置

启动后配置完,提示以下报错信息
start...
配置存在以下问题:

没有选择表
这个是在哪里配置的呢

添加新功能

可以在mapper中添加批量添加和批量修改的方法嘛?用foreach的形式,这样就完美呢。

勾选启用代码生成插件没有生成CommonResponse

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

生成Controller代码的时候,有个CommonResponse类没有生成,import这个类的路径里面有空格。
{bastPackage} .common.CommonResponse;

Expected behaviori

import的路径里面不应该有空格,CommonResponse应该要正确的生成。

Minimal reproduction of the problem with instructions

勾选启用代码生成插件生成rest controller的时候

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

Others:
NA

请问一下有批量生成功能吗?

hi, 好酷的工具,请问一下有批量生成功能吗?
例如:我只想去表前缀,剩下其他默认批量生成库里所有表,比如我50张表没有特殊需求也要一个一个的配置。

在哪里配置表呢

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

Others:

代码clone到本地后运行报错 NSInternalInconsistencyException

错误堆栈如下:

2019-04-15 10:42:45.791 java[56869:3326107] unrecognized type is 4294967295
2019-04-15 10:42:45.791 java[56869:3326107] *** Assertion failure in -[NSEvent _initWithCGEvent:eventRef:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.40.119/AppKit.subproj/NSEvent.m:1977
2019-04-15 10:42:55.269 java[56869:3326107] unrecognized type is 4294967295
2019-04-15 10:42:55.269 java[56869:3326107] *** Assertion failure in -[NSEvent _initWithCGEvent:eventRef:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.40.119/AppKit.subproj/NSEvent.m:1977
2019-04-15 10:43:00.670 java[56869:3326107] unrecognized type is 4294967295
2019-04-15 10:43:00.671 java[56869:3326107] *** Assertion failure in -[NSEvent _initWithCGEvent:eventRef:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.40.119/AppKit.subproj/NSEvent.m:1977
2019-04-15 10:43:00.675 java[56869:3326107] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: _type > 0 && _type <= kCGSLastEventType'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff30b0bcf9 __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff5b69ba17 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff30b26a16 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x00007fff32db8e11 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
	4   AppKit                              0x00007fff2e0e5257 -[NSEvent _initWithCGEvent:eventRef:] + 3296
	5   AppKit                              0x00007fff2e431557 +[NSEvent eventWithCGEvent:] + 117
	6   libglass.dylib                      0x0000000127bfa93b listenTouchEvents + 59
	7   SkyLight                            0x00007fff55fe5454 _ZL19processEventTapDataPvjjjPhj + 157
	8   SkyLight                            0x00007fff55ee5d64 _XPostEventTapData + 277
	9   SkyLight                            0x00007fff55fe5359 _ZL22eventTapMessageHandlerP12__CFMachPortPvlS1_ + 132
	10  CoreFoundation                      0x00007fff30a6dc1d __CFMachPortPerform + 282
	11  CoreFoundation                      0x00007fff30a6daf7 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
	12  CoreFoundation                      0x00007fff30a6da55 __CFRunLoopDoSource1 + 527
	13  CoreFoundation                      0x00007fff30a55a3c __CFRunLoopRun + 2524
	14  CoreFoundation                      0x00007fff30a54e0e CFRunLoopRunSpecific + 455
	15  Foundation                          0x00007fff32caba9f -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280
	16  libglass.dylib                      0x0000000127be86d8 +[GlassApplication enterNestedEventLoopWithEnv:] + 136
	17  libglass.dylib                      0x0000000127be913a Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 74
	18  ???                                 0x00000001112219f4 0x0 + 4582414836
	19  ???                                 0x0000000111212040 0x0 + 4582350912
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

将配置保存到项目中,而不是保存在工具所在目录

I'm submitting a...

  • Feature request (功能建议)

Expected behavior

配置文件保存位置

目前本工具的配置文件是跟着工具走,而不是跟着项目走,在重新生成时找配置文件略麻烦

  • 保存配置的行为修改为:将配置保存到指定项目根目录下的mybatis-getneration-config.json, 方便日后项目表结构改变时重新生成代码。另外,每个项目可保存多个生成配置,方便在开发多模块项目时的代码生成

  • 将原来的保存配置修改为保存为模版,所保存的文件仍存储在工具所在目录

生成的controller接收的主键参数类型不对

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

数据库主键字段类型是bigint,对应生成的dao层代码类型是Long,但是controller生成的类型是Integer

Expected behavior

controller也应该生成Long类型的

Minimal reproduction of the problem with instructions

@RequestMapping(path = "", method = RequestMethod.DELETE)
    @Transactional
    public long deleteBatch(@RequestParam("id") List<Integer> ids) {//这里是integer
        long count = 0;
        for (Integer id : ids) {
            count += mapper.deleteByPrimaryKey(id);//这里接受的Long
        }
        return count;
    }

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

Others:
N/A

找不到javafx.scene.control.Dialog的类文件

H:\下载\mybatis-generator-gui-extension-master\src\main\java\com\spawpaw\mybatis\generator\gui\controller\BaseController.java
Error:(82, 14) java: 无法访问javafx.scene.control.Dialog
找不到javafx.scene.control.Dialog的类文件

oracle

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Others:

连不上oracle数据库

新建连接的事后测试连接按钮点击没反应,创建之后双击连接也没反应。
但是用 idea 导入,直接运行com.spawpaw.mybatis.generator.gui.GeneratorGuiRunner 是可以连接上oracle的。
针对这个问题希望能解决一下,感谢

生成JPA注解部分注解没有生成

I'm submitting a...

  • Bug report (BUG 报告)

Current behavior

com.spawpaw.mybatis.generator.gui.plugin.CommentPlugin.addFieldAnnotation(Field, IntrospectedTable, IntrospectedColumn, Set)
CommentPlugin类357行该方法在生成代码时即使勾选了生成jpa注解也不会有效
2.5.4

Expected behavior

我需要标准的jpa@Id 和我自己修改后加上的@column注解 发现根本走不到这个方法 另外建议源码直接提供@column注解 大部分如果需要用jpa标准的话这个是很需要

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • input your database name

建议MYSQL TINYINT(1) 字段 映射为Boolean

I'm submitting a...

  • Feature request (功能建议)

Current behavior

目前MYSQL TINYINT(1) 字段 映射到java entity是 Byte类型

Expected behavior

建议映射为 Boolean类型,因为已经指定了长度为1

在双击选择表的时候出现错误?正常吗?

I'm submitting a...

  • Bug report (BUG 报告)
  • Feature request (功能建议)
  • Documentation issue or request (文档相关)

Current behavior

双击连接,选择表的时候出现:

Non-grouping field 'TABLE_TYPE' is used in HAVING clause. 提示

测试连接是成功的

Expected behavior

Minimal reproduction of the problem with instructions

Environment

JDK Version:

  • OracleJDK 8u40+
  • OpenJDK 8+ with openjfx

Database:

  • MySQL/MariaDB
  • Oracle
  • SQL Server
  • others

Others:

数据连接中的表不是按表名排序的吗?

你好,你的MBG很好用,谢谢你的分享!只是有一个小问题,我在连接数据库后,显示出来的数据表不是按表名排序的,找表很费劲,这个功能能实现吗?

分页插件功能不能正常使用

I'm submitting a...

  • Bug report (BUG 报告) 分页插件功能不能正常使用

Current behavior

分页插件功能启用之后不能生成带分页的example文件,没有正确加载PagePlugin
在以下位置

com.spawpaw.mybatis.generator.gui.ProjectConfig line:75

添加

@EnablePlugin(DeclaredPlugins.PagePlugin)

注释后恢复

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.