提交 e587b051 authored 作者: ww1xhqc's avatar ww1xhqc

[数据模型] 优化新增String长度

上级 265a73d1
......@@ -25,6 +25,7 @@ import java.util.List;
*/
public class CreateTableUtil {
public static String createTable(TableVO tableVO){
// 1sql-type="text" string 转为text文本,2长度超过会自动转换
List<ColumnVO> dataList = tableVO.getDataList();
String xmlMapping = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<!DOCTYPE hibernate-mapping PUBLIC\n" +
......@@ -38,11 +39,12 @@ public class CreateTableUtil {
" </id>";
for (ColumnVO columnVO : dataList) {
xmlMapping +=
" <property type=\"" + columnVO.getFieldType() + "\" name=\"" + columnVO.getFieldName() +
" <property type=\"" + columnVO.getFieldType() + "\" name=\"" + columnVO.getFieldName() +"\" length=\"" + columnVO.getFieldLength()+
"\" column=\"" + columnVO.getFieldName() + "\"/>\n";
}
xmlMapping += " </class>" +
xmlMapping += " </class>\n" +
"</hibernate-mapping>";
return xmlMapping;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论