Commit 43d54978 authored by yanzg's avatar yanzg

修改实体位置

parent 1cb5b280
......@@ -39,6 +39,11 @@ public class TableStruct {
this.name = "";
}
public TableStruct(String name) {
this.name = name;
}
/**
* 通过实体的字段来创建表结构信息
*
......@@ -91,16 +96,27 @@ public class TableStruct {
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);
// 根据字段名称规则来获取名称默认类型
int stringAction = getStringAction(vo);
// 判断是否属于主键
int resultActionType = getActionType(fieldAction, stringAction);
// 获取普通类型字段列表
List<TableFieldVo> commonActionList = this.getFieldActionList(DaoConst.FIELD_COMMON);
// 判断是否属于主键
int resultActionType = getActionType(fieldAction, stringAction);
if (resultActionType == DaoConst.FIELD_PRIMARY) {
// 将历史主键添加到普通列,并且移除历史主键
List<TableFieldVo> primaryActionList = this.getFieldActionList(DaoConst.FIELD_PRIMARY);
......@@ -134,7 +150,6 @@ public class TableStruct {
}
}
}
}
/**
......
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