I have tried:
select sort(obj.displayName, 'lhs < rhs') from my.org.BusinessClass obj
and
select sort(obj.displayName, 'lhs.toString() < rhs.toString()') from my.org.BusinessClass obj
Both give me character array results, but none of them are sorted by String. I think it's sorting by object id.
I have also tried:
select sort(obj.displayName, lhs < rhs) from my.org.BusinessClass obj
select sort(obj.displayName, lhs.toString() < rhs.toString()) from my.org.BusinessClass obj
But these result in errors because sort second argument is suppose to a string expression.
The examples on the VisualVM documentation are only for numbers: Analyzing a Heap Dump Using Object Query Language (OQL)
The class is structured as follows:
package my.org;
public class BusinessClass {
private String displayName;
// rest of class omitted for brevity
}
This is the workaround I used: