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

[数据模型] 修改modelName为空的bug。

上级 fea939f4
...@@ -286,6 +286,7 @@ public class ModelImpl implements ModelService { ...@@ -286,6 +286,7 @@ public class ModelImpl implements ModelService {
String className = getClassName(aClass.toString()); String className = getClassName(aClass.toString());
realName=className; realName=className;
} }
tableVO.setModelName(realName);
//获得类中文描述 //获得类中文描述
if (aClass.isAnnotationPresent(ApiModel.class)) { if (aClass.isAnnotationPresent(ApiModel.class)) {
ApiModel annotation = aClass.getAnnotation(ApiModel.class); ApiModel annotation = aClass.getAnnotation(ApiModel.class);
...@@ -306,16 +307,17 @@ public class ModelImpl implements ModelService { ...@@ -306,16 +307,17 @@ public class ModelImpl implements ModelService {
java.lang.reflect.Type genericType; java.lang.reflect.Type genericType;
List<ColumnVO> list = new ArrayList<>(); List<ColumnVO> list = new ArrayList<>();
for (Field declaredField : declaredFields) { for (Field declaredField : declaredFields) {
ColumnVO columnVO = new ColumnVO();
if (declaredField.isAnnotationPresent(Transient.class)){ if (declaredField.isAnnotationPresent(Transient.class)){
continue; continue;
} }
ColumnVO columnVO = new ColumnVO();
//获得类型 //获得类型
genericType = declaredField.getGenericType(); genericType = declaredField.getGenericType();
//是否主键 //是否主键
if (declaredField.isAnnotationPresent(javax.persistence.Id.class)) { if (declaredField.isAnnotationPresent(javax.persistence.Id.class)) {
columnVO.setPrimaryKey(0); columnVO.setPrimaryKey(0);
} }
columnVO.setFieldType(getTypeName(genericType.toString())); columnVO.setFieldType(getTypeName(genericType.toString()));
columnVO.setFieldName(getClassName(declaredField.toString())); columnVO.setFieldName(getClassName(declaredField.toString()));
columnVO.setFieldLength(setLength(genericType.toString())); columnVO.setFieldLength(setLength(genericType.toString()));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论