auto-generate-code

this is a auto-generate-code

Лицензия

Лицензия

Категории

Категории

Auto Библиотеки уровня приложения Code Generators
Группа

Группа

com.github.sdcxy
Идентификатор

Идентификатор

auto-generate-code
Последняя версия

Последняя версия

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

auto-generate-code
this is a auto-generate-code
Ссылка на сайт

Ссылка на сайт

https://github.com/sdcxy/maven-repository/tree/master/auto-generate-code
Система контроля версий

Система контроля версий

https://github.com/sdcxy/maven-repository.git

Скачать auto-generate-code

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.sdcxy/auto-generate-code/ -->
<dependency>
    <groupId>com.github.sdcxy</groupId>
    <artifactId>auto-generate-code</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.sdcxy/auto-generate-code/
implementation 'com.github.sdcxy:auto-generate-code:1.0.2'
// https://jarcasting.com/artifacts/com.github.sdcxy/auto-generate-code/
implementation ("com.github.sdcxy:auto-generate-code:1.0.2")
'com.github.sdcxy:auto-generate-code:jar:1.0.2'
<dependency org="com.github.sdcxy" name="auto-generate-code" rev="1.0.2">
  <artifact name="auto-generate-code" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.sdcxy', module='auto-generate-code', version='1.0.2')
)
libraryDependencies += "com.github.sdcxy" % "auto-generate-code" % "1.0.2"
[com.github.sdcxy/auto-generate-code "1.0.2"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
com.baomidou : mybatis-plus-generator jar 3.2.0
org.apache.velocity : velocity jar 1.7
dom4j : dom4j jar 1.6.1
org.jyaml : jyaml jar 1.3

test (1)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-test jar 2.1.6.RELEASE

Модули Проекта

Данный проект не имеет модулей.

auto-generate-code

基于mybatis-plus-generator 简易代码生成器

  • 目前支持数据库类型(已测试) mysql sqlServer
  • 需要在配置数据库 在resources/config/dataSource.xml进行配置

使用方法

  1. 在pom文件中添加依赖包,还有相应的数据库依赖包

    <dependency>
          <groupId>com.github.sdcxy</groupId>
          <artifactId>auto-generate-code</artifactId>
          <version>1.0-RELEASE</version>
    </dependency>
    
  2. 配置数据库

  • @version-1.0.0 版本 在resources/config/下创建一个数据库配置文件 dataSource.xml
  1. 实例化MySqlGenerator 或者 SqlServerGenerator
MySqlGenerator mySql = new MySqlGenerator();
SqlServerGenerator sqlServer = new SqlServerGenerator();
  • 默认父级包为: com.github.sdcxy
  • 调用AutoGenerateCode方法进行代码生成
mySql.autoGenerateCode(...params);
sqlServer.autoGenerateCode(...params);
  • 参数说明:
* parentPackageName:父级包
* moduleName: 模块名称
* tableName: 数据库表名(支持字符串或字符串数组)
* tablePrefix: 数据库表前缀

版本说明

  • 2019-09-11 ---- 1.0-RELEASE

    1. 更新版本1.0.0 配置方式按照上面说明
  • 2019-09-13 ---- 1.0.1

    1. 版本1.0.0 中的xml配置方法已经被弃用了,建议使用yml配置方式

    2. 版本1.0.1 启用yml的数据库配置方式,无需配置数据库类型,会自动根据driver-class-name 判断数据库类型

          dataSource:
          driver-class-name: com.mysql.jdbc.Driver
          url: jdbc:mysql://127.0.0.1:3306/demo?characterEncoding=utf8&useSSL=false&useUnicode=true&autoReconnect=true&serverTimezone=Asia/Shanghai
          username: root
          password: root
      
    3. 弃用MySqlGenerator和SqlServerGenerator类,使用GeneratorFactory类代替,使用方法还是一样

    4. 配置文件更新为: yml配置 需要在resources/application.yml 或者 resources/dataSource.yml进行配置

  • 2019-09-13 ---- 1.0.1

    1. 修复enums目录结果,修复语法上的错误
  • 2019-09-14 ---- 1.0.2

    1. 修复1.0.1不能使用的问题,更新1.0.2版本
    2. 1.0.2版本支持spring jdbc模板配置读取

Версии библиотеки

Версия
1.0.2
1.0.1
1.0-RELEASE