.
This commit is contained in:
@@ -477,12 +477,20 @@ public class MetaKit {
|
||||
return plat.get().getKey();
|
||||
}
|
||||
|
||||
public String nextAlias(String x) {
|
||||
return next(x, "");
|
||||
public static String lastAlias;
|
||||
public static String nextAlias() {
|
||||
if (lastAlias == null) {
|
||||
lastAlias = MetaTable.dao.findFirst(
|
||||
"for d in MetaTable\n" +
|
||||
"sort length(d.alias) desc, d.alias desc\n" +
|
||||
"limit 1\n" +
|
||||
"return d.alias", String.class);
|
||||
}
|
||||
return lastAlias = next(lastAlias, "");
|
||||
}
|
||||
|
||||
//使用['a',...,'z'] 创建Table 别名
|
||||
private String next(String x, String end) {
|
||||
private static String next(String x, String end) {
|
||||
if (x == null || "".equals(x)) {
|
||||
return "a" + end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user