@@ -409,18 +409,21 @@ public static String getTableName(String fullName) {
409409 int index = fullName == null ? -1 : fullName .indexOf (":" );
410410 return index < 0 ? fullName : fullName .substring (0 , index );
411411 }
412-
412+
413413 /**获取变量名
414414 * @param fullName
415415 * @return {@link #formatKey(String, boolean, boolean, boolean)} formatColon = true, formatAt = true, formatHyphen = true, firstCase = true
416416 */
417417 public static String getVariableName (String fullName ) {
418+ if (isArrayKey (fullName )) {
419+ fullName = StringUtil .addSuffix (fullName .substring (0 , fullName .length () - 2 ), "list" );
420+ }
418421 return formatKey (fullName , true , true , true , true );
419422 }
420423
421424 /**格式化数组的名称 key[] => keyList; key:alias[] => aliasList; Table-column[] => tableColumnList
422425 * @param key empty ? "list" : key + "List" 且首字母小写
423- * @return {@link #formatKey(String, boolean, boolean, boolean)} formatColon = false, formatAt = false , formatHyphen = true, firstCase = true
426+ * @return {@link #formatKey(String, boolean, boolean, boolean)} formatColon = false, formatAt = true , formatHyphen = true, firstCase = true
424427 */
425428 public static String formatArrayKey (String key ) {
426429 if (isArrayKey (key )) {
@@ -431,20 +434,20 @@ public static String formatArrayKey(String key) {
431434 return key .substring (index + 1 ); //不处理自定义的
432435 }
433436
434- return formatKey (key , false , false , true , true ); //节约性能,除了表对象 Table-column:alias[] ,一般都符合变量命名规范
437+ return formatKey (key , false , true , true , true ); //节约性能,除了数组对象 Table-column:alias[] ,一般都符合变量命名规范
435438 }
436439
437440 /**格式化对象的名称 name => name; name:alias => alias
438441 * @param key name 或 name:alias
439- * @return {@link #formatKey(String, boolean, boolean, boolean)} formatColon = false, formatAt = false , formatHyphen = false, firstCase = true
442+ * @return {@link #formatKey(String, boolean, boolean, boolean)} formatColon = false, formatAt = true , formatHyphen = false, firstCase = true
440443 */
441444 public static String formatObjectKey (String key ) {
442445 int index = key == null ? -1 : key .indexOf (":" );
443446 if (index >= 0 ) {
444447 return key .substring (index + 1 ); //不处理自定义的
445448 }
446449
447- return formatKey (key , false , false , false , true ); //节约性能,除了表对象 Table:alias ,一般都符合变量命名规范
450+ return formatKey (key , false , true , false , true ); //节约性能,除了表对象 Table:alias ,一般都符合变量命名规范
448451 }
449452
450453 /**格式化普通值的名称 name => name; name:alias => alias
0 commit comments