|
|
@ -40,10 +40,11 @@ public class GenUtils
|
|
|
|
column.setCreateBy(table.getCreateBy());
|
|
|
|
column.setCreateBy(table.getCreateBy());
|
|
|
|
// 设置java字段名
|
|
|
|
// 设置java字段名
|
|
|
|
column.setJavaField(StringUtils.toCamelCase(columnName));
|
|
|
|
column.setJavaField(StringUtils.toCamelCase(columnName));
|
|
|
|
|
|
|
|
// 设置默认类型
|
|
|
|
|
|
|
|
column.setJavaType(GenConstants.TYPE_STRING);
|
|
|
|
|
|
|
|
|
|
|
|
if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType))
|
|
|
|
if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
column.setJavaType(GenConstants.TYPE_STRING);
|
|
|
|
|
|
|
|
// 字符串长度超过500设置为文本域
|
|
|
|
// 字符串长度超过500设置为文本域
|
|
|
|
Integer columnLength = getColumnLength(column.getColumnType());
|
|
|
|
Integer columnLength = getColumnLength(column.getColumnType());
|
|
|
|
String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT;
|
|
|
|
String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT;
|
|
|
|