【fix sonar】CodeGenerateOneToMany文件

This commit is contained in:
梁琦涛
2023-03-31 17:38:21 +08:00
parent aaf93bc8f8
commit 5ce9dbee67
@@ -91,6 +91,20 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
} }
} }
setSubTableVo();
// put从表集合
hashMap.put("subTables", this.subTables);
} catch (Exception e) {
throw e;
}
long serialVersionUID = NonceUtils.getSecureRandomLong() + NonceUtils.getCurrentTimeMillis();
hashMap.put("serialVersionUID", String.valueOf(serialVersionUID));
log.info("code template data: " + hashMap.toString());
return hashMap;
}
private void setSubTableVo() throws Exception {
for (SubTableVo subTableVo : this.subTables) { for (SubTableVo subTableVo : this.subTables) {
// 从表(局部变量) // 从表(局部变量)
List<ColumnVo> originalColumns; List<ColumnVo> originalColumns;
@@ -118,16 +132,6 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
subTableVo.setForeignKeys(list.toArray(new String[0])); subTableVo.setForeignKeys(list.toArray(new String[0]));
subTableVo.setOriginalForeignKeys(foreignKeys); subTableVo.setOriginalForeignKeys(foreignKeys);
} }
// put从表集合
hashMap.put("subTables", this.subTables);
} catch (Exception e) {
throw e;
}
long serialVersionUID = NonceUtils.getSecureRandomLong() + NonceUtils.getCurrentTimeMillis();
hashMap.put("serialVersionUID", String.valueOf(serialVersionUID));
log.info("code template data: " + hashMap.toString());
return hashMap;
} }
@Override @Override