mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
fix: 只有辅助类字段才会排序。
This commit is contained in:
parent
d071a07012
commit
2440e42084
@ -114,12 +114,17 @@ public class Table {
|
||||
}
|
||||
|
||||
public List<Column> getColumns() {
|
||||
// 生成字段排序
|
||||
columns.sort(Comparator.comparingInt((Column c) -> c.getProperty().length())
|
||||
.thenComparing(Column::getProperty));
|
||||
return columns;
|
||||
}
|
||||
|
||||
public List<Column> getSortedColumns() {
|
||||
ArrayList<Column> arrayList = new ArrayList<>(columns);
|
||||
// 生成字段排序
|
||||
arrayList.sort(Comparator.comparingInt((Column c) -> c.getProperty().length())
|
||||
.thenComparing(Column::getProperty));
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public void setColumns(List<Column> columns) {
|
||||
this.columns = columns;
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ public class #(tableDefClassName) extends TableDef {
|
||||
*/
|
||||
public static final #(tableDefClassName) #(tableDefConfig.buildFieldName(table.buildEntityClassName() + tableDefConfig.instanceSuffix)) = new #(tableDefClassName)();
|
||||
|
||||
#for(column: table.columns)
|
||||
#for(column: table.getSortedColumns())
|
||||
#(column.buildComment())
|
||||
public final QueryColumn #(tableDefConfig.buildFieldName(column.property)) = new QueryColumn(this, "#(column.name)");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user