|
@@ -40,13 +40,14 @@ public class GenUtils |
|
@@ -40,13 +40,14 @@ public class GenUtils |
|
40
|
column.setCreateBy(table.getCreateBy());
|
40
|
column.setCreateBy(table.getCreateBy());
|
|
41
|
// 设置java字段名
|
41
|
// 设置java字段名
|
|
42
|
column.setJavaField(StringUtils.toCamelCase(columnName));
|
42
|
column.setJavaField(StringUtils.toCamelCase(columnName));
|
|
|
|
43
|
+ // 设置默认类型
|
|
|
|
44
|
+ column.setJavaType(GenConstants.TYPE_STRING);
|
|
43
|
|
45
|
|
|
44
|
- if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType))
|
46
|
+ if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType))
|
|
45
|
{
|
47
|
{
|
|
46
|
- column.setJavaType(GenConstants.TYPE_STRING);
|
|
|
|
47
|
// 字符串长度超过500设置为文本域
|
48
|
// 字符串长度超过500设置为文本域
|
|
48
|
Integer columnLength = getColumnLength(column.getColumnType());
|
49
|
Integer columnLength = getColumnLength(column.getColumnType());
|
|
49
|
- String htmlType = columnLength >= 500 ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT;
|
50
|
+ String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT;
|
|
50
|
column.setHtmlType(htmlType);
|
51
|
column.setHtmlType(htmlType);
|
|
51
|
}
|
52
|
}
|
|
52
|
else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType))
|
53
|
else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType))
|