Commit bc41a25c by Admin Committed by Gitee

update src/main/java/io/renren/utils/GenUtils.java.

修改了表名转换成Java类名方法存在的bug
例如当表名为t_course_content_file,配置tablePrefix=t_时转换后String className = "CourseContenfile",转换错误!
parent b07152fb
......@@ -275,7 +275,9 @@ public class GenUtils {
public static String tableToJava(String tableName, String[] tablePrefixArray) {
if (null != tablePrefixArray && tablePrefixArray.length > 0) {
for (String tablePrefix : tablePrefixArray) {
tableName = tableName.replace(tablePrefix, "");
if (tableName.startsWith(tablePrefix)){
tableName = tableName.replaceFirst(tablePrefix, "");
}
}
}
return columnToJava(tableName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment