Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-generator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
余保谷
ydl-generator
Commits
38dc7e42
Commit
38dc7e42
authored
Apr 11, 2019
by
flying-cattle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级到3.0版本
parent
9214bf2c
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
180 additions
and
180 deletions
+180
-180
pom.xml
pom.xml
+1
-1
DateType.java
src/main/java/com/github/mybatis/fl/convert/DateType.java
+37
-37
DbColumnType.java
src/main/java/com/github/mybatis/fl/convert/DbColumnType.java
+2
-2
IColumnType.java
src/main/java/com/github/mybatis/fl/convert/IColumnType.java
+38
-38
ITypeConvert.java
src/main/java/com/github/mybatis/fl/convert/ITypeConvert.java
+2
-2
MySqlTypeConvert.java
src/main/java/com/github/mybatis/fl/convert/MySqlTypeConvert.java
+84
-84
BasisInfo.java
src/main/java/com/github/mybatis/fl/entity/BasisInfo.java
+2
-2
GeneratorFileUrl.java
src/main/java/com/github/mybatis/fl/entity/GeneratorFileUrl.java
+2
-2
JsonResult.java
src/main/java/com/github/mybatis/fl/entity/JsonResult.java
+2
-2
PropertyInfo.java
src/main/java/com/github/mybatis/fl/entity/PropertyInfo.java
+2
-2
EntityInfoUtil.java
src/main/java/com/github/mybatis/fl/util/EntityInfoUtil.java
+2
-2
FreemarkerUtil.java
src/main/java/com/github/mybatis/fl/util/FreemarkerUtil.java
+2
-2
Generator.java
src/main/java/com/github/mybatis/fl/util/Generator.java
+2
-2
MySqlToJavaUtil.java
src/main/java/com/github/mybatis/fl/util/MySqlToJavaUtil.java
+2
-2
No files found.
pom.xml
View file @
38dc7e42
...
...
@@ -5,7 +5,7 @@
<groupId>
com.github.flying-cattle
</groupId>
<artifactId>
mybatis-dsc-generator
</artifactId>
<version>
2.1
.0.RELEASE
</version>
<version>
3.0
.0.RELEASE
</version>
<packaging>
jar
</packaging>
<name>
mybatis-dsc-generator
</name>
...
...
src/main/java/com/github/mybatis/fl/convert/DateType.java
View file @
38dc7e42
/**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
* @Package: com.github.mybatis.fl.convert
* @author: flying-cattle
* @date: 2019年4月9日 下午8:15:25
*/
package
com
.
github
.
mybatis
.
fl
.
convert
;
/**
* Copyright: Copyright (c) 2019
*
* <p>说明: 数据库时间类型 到 实体类时间类型 对应策略</P>
* @version: v
2.1.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1.0 initialize
*/
public
enum
DateType
{
/**
*
* <p>只使用 java.util.date 代替</p>
*/
ONLY_DATE
,
/**
* <p>使用 java.sql 包下的</p>
*/
SQL_PACK
,
/**
* <p>使用 java.time 包下的</p>
* <p>java8 新的时间类型</p>
*/
TIME_PACK
}
/**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
* @Package: com.github.mybatis.fl.convert
* @author: flying-cattle
* @date: 2019年4月9日 下午8:15:25
*/
package
com
.
github
.
mybatis
.
fl
.
convert
;
/**
* Copyright: Copyright (c) 2019
*
* <p>说明: 数据库时间类型 到 实体类时间类型 对应策略</P>
* @version: v
3.0.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
3.0.0 initialize
*/
public
enum
DateType
{
/**
*
* <p>只使用 java.util.date 代替</p>
*/
ONLY_DATE
,
/**
* <p>使用 java.sql 包下的</p>
*/
SQL_PACK
,
/**
* <p>使用 java.time 包下的</p>
* <p>java8 新的时间类型</p>
*/
TIME_PACK
}
src/main/java/com/github/mybatis/fl/convert/DbColumnType.java
View file @
38dc7e42
...
...
@@ -11,13 +11,13 @@ package com.github.mybatis.fl.convert;
* Copyright: Copyright (c) 2019
*
* <p>说明:表字段类型</p>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
public
enum
DbColumnType
implements
IColumnType
{
// 基本类型
...
...
src/main/java/com/github/mybatis/fl/convert/IColumnType.java
View file @
38dc7e42
/**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* @Package: com.github.mybatis.fl.convert
* @author: flying-cattle
* @date: 2019年4月9日 下午8:09:35
*/
package
com
.
github
.
mybatis
.
fl
.
convert
;
/**
* Copyright: Copyright (c) 2019
*
* <p>说明: 获取实体类字段属性类信息接口</p>
* @version: v
2.1.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1.0 initialize
*/
public
interface
IColumnType
{
/**
* <p>获取字段类型</p>
*
* @return 字段类型
*/
String
getType
();
/**
* <p> 获取字段类型完整名</p>
*
* @return 字段类型完整名
*/
String
getPkg
();
}
/**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* @Package: com.github.mybatis.fl.convert
* @author: flying-cattle
* @date: 2019年4月9日 下午8:09:35
*/
package
com
.
github
.
mybatis
.
fl
.
convert
;
/**
* Copyright: Copyright (c) 2019
*
* <p>说明: 获取实体类字段属性类信息接口</p>
* @version: v
3.0.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
3.0.0 initialize
*/
public
interface
IColumnType
{
/**
* <p>获取字段类型</p>
*
* @return 字段类型
*/
String
getType
();
/**
* <p> 获取字段类型完整名</p>
*
* @return 字段类型完整名
*/
String
getPkg
();
}
src/main/java/com/github/mybatis/fl/convert/ITypeConvert.java
View file @
38dc7e42
...
...
@@ -13,13 +13,13 @@ package com.github.mybatis.fl.convert;
* Copyright: Copyright (c) 2019
*
* <p>说明: 该类的功能描述</p>
* @version: v
1
.0.0
* @version: v
3
.0.0
* @author: flying-cattle
*
* Modification History:
* 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
{
/**
...
...
src/main/java/com/github/mybatis/fl/convert/MySqlTypeConvert.java
View file @
38dc7e42
/**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
*
* @Package: com.github.mybatis.fl.convert
* @author: flying-cattle
* @date: 2019年4月9日 下午8:13:13
*/
package
com
.
github
.
mybatis
.
fl
.
convert
;
import
com.github.mybatis.fl.convert.ITypeConvert
;
/**
* Copyright: Copyright (c) 2019
*
* <p>说明:MYSQL 数据库字段类型转换</p>
* @version: v
1.0.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.0.1 initialize
*/
public
class
MySqlTypeConvert
implements
ITypeConvert
{
@Override
public
IColumnType
processTypeConvert
(
DateType
dateType
,
String
fieldType
)
{
String
t
=
fieldType
.
toLowerCase
();
if
(
t
.
contains
(
"char"
))
{
return
DbColumnType
.
STRING
;
}
else
if
(
t
.
contains
(
"bigint"
))
{
return
DbColumnType
.
LONG
;
}
else
if
(
t
.
contains
(
"tinyint(1)"
))
{
return
DbColumnType
.
BOOLEAN
;
}
else
if
(
t
.
contains
(
"int"
))
{
return
DbColumnType
.
INTEGER
;
}
else
if
(
t
.
contains
(
"text"
))
{
return
DbColumnType
.
STRING
;
}
else
if
(
t
.
contains
(
"bit"
))
{
return
DbColumnType
.
BOOLEAN
;
}
else
if
(
t
.
contains
(
"decimal"
))
{
return
DbColumnType
.
BIG_DECIMAL
;
}
else
if
(
t
.
contains
(
"clob"
))
{
return
DbColumnType
.
CLOB
;
}
else
if
(
t
.
contains
(
"blob"
))
{
return
DbColumnType
.
BLOB
;
}
else
if
(
t
.
contains
(
"binary"
))
{
return
DbColumnType
.
BYTE_ARRAY
;
}
else
if
(
t
.
contains
(
"float"
))
{
return
DbColumnType
.
FLOAT
;
}
else
if
(
t
.
contains
(
"double"
))
{
return
DbColumnType
.
DOUBLE
;
}
else
if
(
t
.
contains
(
"json"
)
||
t
.
contains
(
"enum"
))
{
return
DbColumnType
.
STRING
;
}
else
if
(
t
.
contains
(
"date"
)
||
t
.
contains
(
"time"
)
||
t
.
contains
(
"year"
))
{
switch
(
dateType
)
{
case
ONLY_DATE:
return
DbColumnType
.
DATE
;
case
SQL_PACK:
switch
(
t
)
{
case
"date"
:
return
DbColumnType
.
DATE_SQL
;
case
"time"
:
return
DbColumnType
.
TIME
;
case
"year"
:
return
DbColumnType
.
DATE_SQL
;
default
:
return
DbColumnType
.
TIMESTAMP
;
}
case
TIME_PACK:
switch
(
t
)
{
case
"date"
:
return
DbColumnType
.
LOCAL_DATE
;
case
"time"
:
return
DbColumnType
.
LOCAL_TIME
;
case
"year"
:
return
DbColumnType
.
YEAR
;
default
:
return
DbColumnType
.
LOCAL_DATE_TIME
;
}
}
}
return
DbColumnType
.
STRING
;
}
}
/**
* Copyright © 2019 dream horse Info. Tech Ltd. All rights reserved.
*
* @Package: com.github.mybatis.fl.convert
* @author: flying-cattle
* @date: 2019年4月9日 下午8:13:13
*/
package
com
.
github
.
mybatis
.
fl
.
convert
;
import
com.github.mybatis.fl.convert.ITypeConvert
;
/**
* Copyright: Copyright (c) 2019
*
* <p>说明:MYSQL 数据库字段类型转换</p>
* @version: v
3.0.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
3.0.0 initialize
*/
public
class
MySqlTypeConvert
implements
ITypeConvert
{
@Override
public
IColumnType
processTypeConvert
(
DateType
dateType
,
String
fieldType
)
{
String
t
=
fieldType
.
toLowerCase
();
if
(
t
.
contains
(
"char"
))
{
return
DbColumnType
.
STRING
;
}
else
if
(
t
.
contains
(
"bigint"
))
{
return
DbColumnType
.
LONG
;
}
else
if
(
t
.
contains
(
"tinyint(1)"
))
{
return
DbColumnType
.
BOOLEAN
;
}
else
if
(
t
.
contains
(
"int"
))
{
return
DbColumnType
.
INTEGER
;
}
else
if
(
t
.
contains
(
"text"
))
{
return
DbColumnType
.
STRING
;
}
else
if
(
t
.
contains
(
"bit"
))
{
return
DbColumnType
.
BOOLEAN
;
}
else
if
(
t
.
contains
(
"decimal"
))
{
return
DbColumnType
.
BIG_DECIMAL
;
}
else
if
(
t
.
contains
(
"clob"
))
{
return
DbColumnType
.
CLOB
;
}
else
if
(
t
.
contains
(
"blob"
))
{
return
DbColumnType
.
BLOB
;
}
else
if
(
t
.
contains
(
"binary"
))
{
return
DbColumnType
.
BYTE_ARRAY
;
}
else
if
(
t
.
contains
(
"float"
))
{
return
DbColumnType
.
FLOAT
;
}
else
if
(
t
.
contains
(
"double"
))
{
return
DbColumnType
.
DOUBLE
;
}
else
if
(
t
.
contains
(
"json"
)
||
t
.
contains
(
"enum"
))
{
return
DbColumnType
.
STRING
;
}
else
if
(
t
.
contains
(
"date"
)
||
t
.
contains
(
"time"
)
||
t
.
contains
(
"year"
))
{
switch
(
dateType
)
{
case
ONLY_DATE:
return
DbColumnType
.
DATE
;
case
SQL_PACK:
switch
(
t
)
{
case
"date"
:
return
DbColumnType
.
DATE_SQL
;
case
"time"
:
return
DbColumnType
.
TIME
;
case
"year"
:
return
DbColumnType
.
DATE_SQL
;
default
:
return
DbColumnType
.
TIMESTAMP
;
}
case
TIME_PACK:
switch
(
t
)
{
case
"date"
:
return
DbColumnType
.
LOCAL_DATE
;
case
"time"
:
return
DbColumnType
.
LOCAL_TIME
;
case
"year"
:
return
DbColumnType
.
YEAR
;
default
:
return
DbColumnType
.
LOCAL_DATE_TIME
;
}
}
}
return
DbColumnType
.
STRING
;
}
}
src/main/java/com/github/mybatis/fl/entity/BasisInfo.java
View file @
38dc7e42
...
...
@@ -17,13 +17,13 @@ import lombok.NoArgsConstructor;
* Copyright: Copyright (c) 2019
*
* <p>说明: 自动生成需要的基本信息</P>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
@Data
@AllArgsConstructor
...
...
src/main/java/com/github/mybatis/fl/entity/GeneratorFileUrl.java
View file @
38dc7e42
...
...
@@ -15,13 +15,13 @@ import lombok.NoArgsConstructor;
* Copyright: Copyright (c) 2019
*
* <p>说明: 自动生成文件路径</P>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
@Data
@AllArgsConstructor
...
...
src/main/java/com/github/mybatis/fl/entity/JsonResult.java
View file @
38dc7e42
...
...
@@ -16,13 +16,13 @@ import lombok.NoArgsConstructor;
* Copyright: Copyright (c) 2019
*
* <p>说明: 返回结果json对象</P>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
@Data
...
...
src/main/java/com/github/mybatis/fl/entity/PropertyInfo.java
View file @
38dc7e42
...
...
@@ -16,13 +16,13 @@ import lombok.NoArgsConstructor;
* Copyright: Copyright (c) 2019
*
* <p>说明: 获取到数据库的信息</P>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
@Data
@AllArgsConstructor
...
...
src/main/java/com/github/mybatis/fl/util/EntityInfoUtil.java
View file @
38dc7e42
...
...
@@ -20,13 +20,13 @@ import com.github.mybatis.fl.entity.PropertyInfo;
* Copyright: Copyright (c) 2019
*
* <p>说明: 链接数据库并获取表信息</P>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
public
class
EntityInfoUtil
{
public
static
BasisInfo
getInfo
(
BasisInfo
bi
)
throws
SQLException
{
...
...
src/main/java/com/github/mybatis/fl/util/FreemarkerUtil.java
View file @
38dc7e42
...
...
@@ -20,13 +20,13 @@ import freemarker.template.Template;
* Copyright: Copyright (c) 2019
*
* <p>说明: 创建文件</P>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
public
class
FreemarkerUtil
{
...
...
src/main/java/com/github/mybatis/fl/util/Generator.java
View file @
38dc7e42
...
...
@@ -16,13 +16,13 @@ import com.github.mybatis.fl.entity.PropertyInfo;
* Copyright: Copyright (c) 2019
*
* <p>说明: 获取文件路径调用创建文件</P>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
public
class
Generator
{
//路径信息
...
...
src/main/java/com/github/mybatis/fl/util/MySqlToJavaUtil.java
View file @
38dc7e42
...
...
@@ -12,13 +12,13 @@ import com.github.mybatis.fl.convert.MySqlTypeConvert;
* Copyright: Copyright (c) 2019
*
* <p>说明: 获奖java中需要的驼峰命名</P>
* @version: v
2.1
.0
* @version: v
3.0
.0
* @author: flying-cattle
*
* Modification History:
* Date Author Version Description
*---------------------------------------------------------------*
* 2019年4月9日 flying-cattle v
2.1
.0 initialize
* 2019年4月9日 flying-cattle v
3.0
.0 initialize
*/
public
class
MySqlToJavaUtil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment