title: How to sort strings in OQL
body: <p>I have tried:</p>
  
  <pre><code>select sort(obj.displayName, 'lhs &lt; rhs') from my.org.BusinessClass obj
  </code></pre>
  
  <p>and</p>
  
  <pre><code>select sort(obj.displayName, 'lhs.toString() &lt; rhs.toString()') from my.org.BusinessClass obj
  </code></pre>
  
  <p>Both give me character array results, but none of them are sorted by String. I think it's sorting by object id.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>select sort(obj.displayName, lhs &lt; rhs) from my.org.BusinessClass obj 
  select sort(obj.displayName, lhs.toString() &lt; rhs.toString()) from my.org.BusinessClass obj
  </code></pre>
  
  <p>But these result in errors because sort second argument is suppose to a string expression.</p>
  
  <p>The examples on the VisualVM documentation are only for numbers: <a href="https://visualvm.java.net/oqlhelp.html" rel="nofollow noreferrer">
  Analyzing a Heap Dump Using Object Query Language (OQL)</a> </p>
  
  <p>The class is structured as follows:</p>
  
  <pre><code>package my.org;
  public class BusinessClass {
      private String displayName;
      // rest of class omitted for brevity 
  }
  </code></pre>