Commit 38dc7e42 by flying-cattle

升级到3.0版本

parent 9214bf2c
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<groupId>com.github.flying-cattle</groupId> <groupId>com.github.flying-cattle</groupId>
<artifactId>mybatis-dsc-generator</artifactId> <artifactId>mybatis-dsc-generator</artifactId>
<version>2.1.0.RELEASE</version> <version>3.0.0.RELEASE</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>mybatis-dsc-generator</name> <name>mybatis-dsc-generator</name>
......
/** /**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved. * Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
* @Package: com.github.mybatis.fl.convert * @Package: com.github.mybatis.fl.convert
* @author: flying-cattle * @author: flying-cattle
* @date: 2019年4月9日 下午8:15:25 * @date: 2019年4月9日 下午8:15:25
*/ */
package com.github.mybatis.fl.convert; package com.github.mybatis.fl.convert;
/** /**
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 数据库时间类型 到 实体类时间类型 对应策略</P> * <p>说明: 数据库时间类型 到 实体类时间类型 对应策略</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public enum DateType { public enum DateType {
/** /**
* *
* <p>只使用 java.util.date 代替</p> * <p>只使用 java.util.date 代替</p>
*/ */
ONLY_DATE, ONLY_DATE,
/** /**
* <p>使用 java.sql 包下的</p> * <p>使用 java.sql 包下的</p>
*/ */
SQL_PACK, SQL_PACK,
/** /**
* <p>使用 java.time 包下的</p> * <p>使用 java.time 包下的</p>
* <p>java8 新的时间类型</p> * <p>java8 新的时间类型</p>
*/ */
TIME_PACK TIME_PACK
} }
...@@ -11,13 +11,13 @@ package com.github.mybatis.fl.convert; ...@@ -11,13 +11,13 @@ package com.github.mybatis.fl.convert;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明:表字段类型</p> * <p>说明:表字段类型</p>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public enum DbColumnType implements IColumnType { public enum DbColumnType implements IColumnType {
// 基本类型 // 基本类型
......
/** /**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved. * Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
* <p> * <p>
* https://www.apache.org/licenses/LICENSE-2.0 * https://www.apache.org/licenses/LICENSE-2.0
* <p> * <p>
* @Package: com.github.mybatis.fl.convert * @Package: com.github.mybatis.fl.convert
* @author: flying-cattle * @author: flying-cattle
* @date: 2019年4月9日 下午8:09:35 * @date: 2019年4月9日 下午8:09:35
*/ */
package com.github.mybatis.fl.convert; package com.github.mybatis.fl.convert;
/** /**
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 获取实体类字段属性类信息接口</p> * <p>说明: 获取实体类字段属性类信息接口</p>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public interface IColumnType { public interface IColumnType {
/** /**
* <p>获取字段类型</p> * <p>获取字段类型</p>
* *
* @return 字段类型 * @return 字段类型
*/ */
String getType(); String getType();
/** /**
* <p> 获取字段类型完整名</p> * <p> 获取字段类型完整名</p>
* *
* @return 字段类型完整名 * @return 字段类型完整名
*/ */
String getPkg(); String getPkg();
} }
...@@ -13,13 +13,13 @@ package com.github.mybatis.fl.convert; ...@@ -13,13 +13,13 @@ package com.github.mybatis.fl.convert;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 该类的功能描述</p> * <p>说明: 该类的功能描述</p>
* @version: v1.0.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.0.1 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public interface ITypeConvert { public interface ITypeConvert {
/** /**
......
/** /**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved. * Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
* *
* @Package: com.github.mybatis.fl.convert * @Package: com.github.mybatis.fl.convert
* @author: flying-cattle * @author: flying-cattle
* @date: 2019年4月9日 下午8:13:13 * @date: 2019年4月9日 下午8:13:13
*/ */
package com.github.mybatis.fl.convert; package com.github.mybatis.fl.convert;
import com.github.mybatis.fl.convert.ITypeConvert; import com.github.mybatis.fl.convert.ITypeConvert;
/** /**
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明:MYSQL 数据库字段类型转换</p> * <p>说明:MYSQL 数据库字段类型转换</p>
* @version: v1.0.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.0.1 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public class MySqlTypeConvert implements ITypeConvert { public class MySqlTypeConvert implements ITypeConvert {
@Override @Override
public IColumnType processTypeConvert(DateType dateType, String fieldType) { public IColumnType processTypeConvert(DateType dateType, String fieldType) {
String t = fieldType.toLowerCase(); String t = fieldType.toLowerCase();
if (t.contains("char")) { if (t.contains("char")) {
return DbColumnType.STRING; return DbColumnType.STRING;
} else if (t.contains("bigint")) { } else if (t.contains("bigint")) {
return DbColumnType.LONG; return DbColumnType.LONG;
} else if (t.contains("tinyint(1)")) { } else if (t.contains("tinyint(1)")) {
return DbColumnType.BOOLEAN; return DbColumnType.BOOLEAN;
} else if (t.contains("int")) { } else if (t.contains("int")) {
return DbColumnType.INTEGER; return DbColumnType.INTEGER;
} else if (t.contains("text")) { } else if (t.contains("text")) {
return DbColumnType.STRING; return DbColumnType.STRING;
} else if (t.contains("bit")) { } else if (t.contains("bit")) {
return DbColumnType.BOOLEAN; return DbColumnType.BOOLEAN;
} else if (t.contains("decimal")) { } else if (t.contains("decimal")) {
return DbColumnType.BIG_DECIMAL; return DbColumnType.BIG_DECIMAL;
} else if (t.contains("clob")) { } else if (t.contains("clob")) {
return DbColumnType.CLOB; return DbColumnType.CLOB;
} else if (t.contains("blob")) { } else if (t.contains("blob")) {
return DbColumnType.BLOB; return DbColumnType.BLOB;
} else if (t.contains("binary")) { } else if (t.contains("binary")) {
return DbColumnType.BYTE_ARRAY; return DbColumnType.BYTE_ARRAY;
} else if (t.contains("float")) { } else if (t.contains("float")) {
return DbColumnType.FLOAT; return DbColumnType.FLOAT;
} else if (t.contains("double")) { } else if (t.contains("double")) {
return DbColumnType.DOUBLE; return DbColumnType.DOUBLE;
} else if (t.contains("json") || t.contains("enum")) { } else if (t.contains("json") || t.contains("enum")) {
return DbColumnType.STRING; return DbColumnType.STRING;
} else if (t.contains("date") || t.contains("time") || t.contains("year")) { } else if (t.contains("date") || t.contains("time") || t.contains("year")) {
switch (dateType) { switch (dateType) {
case ONLY_DATE: case ONLY_DATE:
return DbColumnType.DATE; return DbColumnType.DATE;
case SQL_PACK: case SQL_PACK:
switch (t) { switch (t) {
case "date": case "date":
return DbColumnType.DATE_SQL; return DbColumnType.DATE_SQL;
case "time": case "time":
return DbColumnType.TIME; return DbColumnType.TIME;
case "year": case "year":
return DbColumnType.DATE_SQL; return DbColumnType.DATE_SQL;
default: default:
return DbColumnType.TIMESTAMP; return DbColumnType.TIMESTAMP;
} }
case TIME_PACK: case TIME_PACK:
switch (t) { switch (t) {
case "date": case "date":
return DbColumnType.LOCAL_DATE; return DbColumnType.LOCAL_DATE;
case "time": case "time":
return DbColumnType.LOCAL_TIME; return DbColumnType.LOCAL_TIME;
case "year": case "year":
return DbColumnType.YEAR; return DbColumnType.YEAR;
default: default:
return DbColumnType.LOCAL_DATE_TIME; return DbColumnType.LOCAL_DATE_TIME;
} }
} }
} }
return DbColumnType.STRING; return DbColumnType.STRING;
} }
} }
...@@ -17,13 +17,13 @@ import lombok.NoArgsConstructor; ...@@ -17,13 +17,13 @@ import lombok.NoArgsConstructor;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 自动生成需要的基本信息</P> * <p>说明: 自动生成需要的基本信息</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
......
...@@ -15,13 +15,13 @@ import lombok.NoArgsConstructor; ...@@ -15,13 +15,13 @@ import lombok.NoArgsConstructor;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 自动生成文件路径</P> * <p>说明: 自动生成文件路径</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
......
...@@ -16,13 +16,13 @@ import lombok.NoArgsConstructor; ...@@ -16,13 +16,13 @@ import lombok.NoArgsConstructor;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 返回结果json对象</P> * <p>说明: 返回结果json对象</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
@Data @Data
......
...@@ -16,13 +16,13 @@ import lombok.NoArgsConstructor; ...@@ -16,13 +16,13 @@ import lombok.NoArgsConstructor;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 获取到数据库的信息</P> * <p>说明: 获取到数据库的信息</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
......
...@@ -20,13 +20,13 @@ import com.github.mybatis.fl.entity.PropertyInfo; ...@@ -20,13 +20,13 @@ import com.github.mybatis.fl.entity.PropertyInfo;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 链接数据库并获取表信息</P> * <p>说明: 链接数据库并获取表信息</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public class EntityInfoUtil { public class EntityInfoUtil {
public static BasisInfo getInfo(BasisInfo bi) throws SQLException { public static BasisInfo getInfo(BasisInfo bi) throws SQLException {
......
...@@ -20,13 +20,13 @@ import freemarker.template.Template; ...@@ -20,13 +20,13 @@ import freemarker.template.Template;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 创建文件</P> * <p>说明: 创建文件</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public class FreemarkerUtil { public class FreemarkerUtil {
......
...@@ -16,13 +16,13 @@ import com.github.mybatis.fl.entity.PropertyInfo; ...@@ -16,13 +16,13 @@ import com.github.mybatis.fl.entity.PropertyInfo;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 获取文件路径调用创建文件</P> * <p>说明: 获取文件路径调用创建文件</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public class Generator { public class Generator {
//路径信息 //路径信息
......
...@@ -12,13 +12,13 @@ import com.github.mybatis.fl.convert.MySqlTypeConvert; ...@@ -12,13 +12,13 @@ import com.github.mybatis.fl.convert.MySqlTypeConvert;
* Copyright: Copyright (c) 2019 * Copyright: Copyright (c) 2019
* *
* <p>说明: 获奖java中需要的驼峰命名</P> * <p>说明: 获奖java中需要的驼峰命名</P>
* @version: v2.1.0 * @version: v3.0.0
* @author: flying-cattle * @author: flying-cattle
* *
* Modification History: * Modification History:
* Date Author Version Description * Date Author Version Description
*---------------------------------------------------------------* *---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v2.1.0 initialize * 2019年4月9日 flying-cattle v3.0.0 initialize
*/ */
public class MySqlToJavaUtil { public class MySqlToJavaUtil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment