title: how to orderBy string date? CriteriaBuilder
body: <p>How can I <code>orderBy</code> string date correctly(in date format) using Criteria builder? because the stored date in my model was string.</p>
  <p>My model:</p>
  <blockquote>
  <p>@Column(name = &quot;date_time&quot;)</p>
  <p>private String dateTime;</p>
  </blockquote>
  <p>When I try to query it.</p>
  <pre><code>    CriteriaBuilder cb = JPA.em().getCriteriaBuilder();
      CriteriaQuery&lt;T&gt; cq = cb.createQuery(Pickup.class);
      Root&lt;T&gt; root = cq.from(Pickup.class);
      CriteriaQuery&lt;T&gt; all = cq.select(root);
  
      cq.orderBy(cb.desc(root.get(&quot;dateTime&quot;)));
  </code></pre>
  <p>I got wrong order, how can I make my string date to date format then orderBy it? I'm very new to it, Can someone help me? thanks in advance.</p>