fix up the bug when column or table has not comment

This commit is contained in:
moshowgame@126.com 2018-09-13 14:10:59 +08:00
parent 4603270887
commit 01932b628d
7 changed files with 15 additions and 6 deletions

View File

@ -59,7 +59,13 @@ public class TableParseUtil {
} }
if (classCommentTmp!=null && classCommentTmp.trim().length()>0) { if (classCommentTmp!=null && classCommentTmp.trim().length()>0) {
classComment = classCommentTmp; classComment = classCommentTmp;
}else{
//修复表备注为空问题
classComment = className;
} }
}else{
//修复表备注为空问题
classComment = className;
} }
// field List // field List
@ -124,6 +130,9 @@ public class TableParseUtil {
commentTmp = commentTmp.substring(commentTmp.indexOf("'")+1, commentTmp.lastIndexOf("'")); commentTmp = commentTmp.substring(commentTmp.indexOf("'")+1, commentTmp.lastIndexOf("'"));
} }
fieldComment = commentTmp; fieldComment = commentTmp;
}else{
//修复comment不存在导致报错的问题
fieldComment = columnName;
} }
FieldInfo fieldInfo = new FieldInfo(); FieldInfo fieldInfo = new FieldInfo();

View File

@ -11,7 +11,7 @@ import java.util.Map;
/** /**
* ${classInfo.classComment} * ${classInfo.classComment}
* *
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'. * Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
*/ */
@Controller @Controller
public class ConfController { public class ConfController {

View File

@ -6,7 +6,7 @@ import java.util.List;
/** /**
* ${classInfo.classComment} * ${classInfo.classComment}
* *
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'. * Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
*/ */
@Component @Component
public interface ${classInfo.className}Dao { public interface ${classInfo.className}Dao {

View File

@ -21,7 +21,7 @@ import java.util.Date;
@Data @Data
@Table(name="${classInfo.tableName}") @Table(name="${classInfo.tableName}")
public class ${classInfo.className} implements Serializable { public class ${classInfo.className} implements Serializable {
private static final long serialVersionUID = 42L; private static final long serialVersionUID = 1L;
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
<#list classInfo.fieldList as fieldItem > <#list classInfo.fieldList as fieldItem >

View File

@ -13,7 +13,7 @@ import java.util.Date;
/** /**
* ${classInfo.classComment} * ${classInfo.classComment}
* *
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'. * Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
*/ */
public class ${classInfo.className} implements Serializable { public class ${classInfo.className} implements Serializable {
private static final long serialVersionUID = 42L; private static final long serialVersionUID = 42L;

View File

@ -3,7 +3,7 @@ import java.util.Map;
/** /**
* ${classInfo.classComment} * ${classInfo.classComment}
* *
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'. * Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
*/ */
public interface ${classInfo.className}Service { public interface ${classInfo.className}Service {

View File

@ -9,7 +9,7 @@ import java.util.Map;
/** /**
* ${classInfo.classComment} * ${classInfo.classComment}
* *
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'. * Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
*/ */
@Service @Service
public class ${classInfo.className}ServiceImpl implements ${classInfo.className}Service { public class ${classInfo.className}ServiceImpl implements ${classInfo.className}Service {