no effective when user addSort function in XPathQuery

0
Dear, I want to sort the result list by the level when retrieve Auth Object. as the sort attribute is the association, then can not sort in Microflow, so I write in java like: List<IMendixObject> objs = xPathQuery.setAmount(-1).setOffset(0)                                                 .addSort("ModuleName.Auth_NomLevel/ModuleName.NomLevel/Level", false)                                                 .execute(ctx); or  map.put("ModuleName.Auth_NomLevel/ModuleName.NomLevel/Level", "DESC"); List<IMendixObject> objs = Core.retrieveXPathQuery(ctx,fullXpathQuery,-1,-1,map);   but these all no effective, I am not sure if the association attribute can be used here, is there any idea how to sort the list by the association attribute.
asked
1 answers
0

hii Juan Wang,

Java sorts on the underlying hexadecimal values of the characters. As the hex value for capital A is lower than the hex value for lowercase a, you will see string values sort based on this.

Solution would be to have another column in your entity in which you store the same strings, only in all lowercase or call uppercase. Then use this column for sorting, use the original column for display.

answered