IDEMPIERE-5140 : Saved Queries should be ordered by name (#1112)

This commit is contained in:
Nicolas Micoud 2022-01-05 03:15:43 +01:00 committed by GitHub
parent 55e9e87f0b
commit a74f76dcc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,8 @@ package org.compiere.model;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
@ -52,6 +54,14 @@ public class MUserQuery extends X_AD_UserQuery
list.addAll(getAllUsersQueries(ctx, AD_Tab_ID)); list.addAll(getAllUsersQueries(ctx, AD_Tab_ID));
list.addAll(getClientQueries(ctx, AD_Tab_ID)); list.addAll(getClientQueries(ctx, AD_Tab_ID));
list.addAll(getRoleQueries(ctx, AD_Tab_ID)); list.addAll(getRoleQueries(ctx, AD_Tab_ID));
Collections.sort(list, new Comparator<MUserQuery>() {
@Override
public int compare(MUserQuery uq1, MUserQuery uq2) {
return uq1.getName().compareTo(uq2.getName());
}
});
MUserQuery[] retValue = new MUserQuery[list.size()]; MUserQuery[] retValue = new MUserQuery[list.size()];
list.toArray(retValue); list.toArray(retValue);
return retValue; return retValue;