Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
43d54978
Commit
43d54978
authored
Mar 04, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实体位置
parent
1cb5b280
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
TableStruct.java
...b/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
+19
-4
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
View file @
43d54978
...
@@ -39,6 +39,11 @@ public class TableStruct {
...
@@ -39,6 +39,11 @@ public class TableStruct {
this
.
name
=
""
;
this
.
name
=
""
;
}
}
public
TableStruct
(
String
name
)
{
this
.
name
=
name
;
}
/**
/**
* 通过实体的字段来创建表结构信息
* 通过实体的字段来创建表结构信息
*
*
...
@@ -91,16 +96,27 @@ public class TableStruct {
...
@@ -91,16 +96,27 @@ public class TableStruct {
fieldAction
=
annotation
.
type
();
fieldAction
=
annotation
.
type
();
}
}
this
.
addField
(
fieldName
,
fieldInputName
,
fieldType
,
fieldAction
);
}
/**
* 添加额外字段
*
* @param fieldName 字段名称
* @param fieldInputName 字段输入名称
* @param fieldType 字段类型
* @param fieldAction 字段含义
*/
public
void
addField
(
String
fieldName
,
String
fieldInputName
,
Class
<?>
fieldType
,
int
fieldAction
)
{
// 将字段组合成输入字段
// 将字段组合成输入字段
TableFieldVo
vo
=
new
TableFieldVo
(
fieldName
,
fieldInputName
,
fieldType
);
TableFieldVo
vo
=
new
TableFieldVo
(
fieldName
,
fieldInputName
,
fieldType
);
// 根据字段名称规则来获取名称默认类型
// 根据字段名称规则来获取名称默认类型
int
stringAction
=
getStringAction
(
vo
);
int
stringAction
=
getStringAction
(
vo
);
// 判断是否属于主键
int
resultActionType
=
getActionType
(
fieldAction
,
stringAction
);
// 获取普通类型字段列表
// 获取普通类型字段列表
List
<
TableFieldVo
>
commonActionList
=
this
.
getFieldActionList
(
DaoConst
.
FIELD_COMMON
);
List
<
TableFieldVo
>
commonActionList
=
this
.
getFieldActionList
(
DaoConst
.
FIELD_COMMON
);
// 判断是否属于主键
int
resultActionType
=
getActionType
(
fieldAction
,
stringAction
);
if
(
resultActionType
==
DaoConst
.
FIELD_PRIMARY
)
{
if
(
resultActionType
==
DaoConst
.
FIELD_PRIMARY
)
{
// 将历史主键添加到普通列,并且移除历史主键
// 将历史主键添加到普通列,并且移除历史主键
List
<
TableFieldVo
>
primaryActionList
=
this
.
getFieldActionList
(
DaoConst
.
FIELD_PRIMARY
);
List
<
TableFieldVo
>
primaryActionList
=
this
.
getFieldActionList
(
DaoConst
.
FIELD_PRIMARY
);
...
@@ -134,7 +150,6 @@ public class TableStruct {
...
@@ -134,7 +150,6 @@ public class TableStruct {
}
}
}
}
}
}
}
}
/**
/**
...
...
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