title: JPA: can't make OrderBy work
body: <p>I'm trying to print ordered list after persisting it and retrieving.</p>
  
  <p>My Entities:</p>
  
  <pre><code>@Entity
  public class News {
      @Id @GeneratedValue
      private Long id;
      private String content;
      @OneToMany(cascade = CascadeType.ALL)
      @OrderBy("likes DESC")
      private List&lt;Comment&gt; comments = new LinkedList&lt;&gt;();
  
      //------------------
  }
  
  @Entity
  public class Comment {
      @Id
      @GeneratedValue
      private Long id;
      private String content;
      private int likes;
  }
  </code></pre>
  
  <p>Main method snippet:</p>
  
  <pre><code>tx.begin();
  {
      // persist
      News n1 = new News("Super news!!");
      Comment c1 = new Comment("comment 1", 1);
      Comment c2 = new Comment("comment 2", 200);
      Comment c3 = new Comment("comment 3", 10);
  
      n1.addComment(c1);
      n1.addComment(c2);
      n1.addComment(c3);
  
      em.persist(n1);
  
      // find
      News news = em.find(News.class, n1.getId());
      for (int i = 0; i &lt; news.getComments().size(); i++) {
          System.err.println(news.getComments().get(i).getLikes());
      }
  }
  tx.commit();
  </code></pre>
  
  <p>The result printed in declaration order (1 -> 200 -> 10) and I expect (200 -> 10 -> 1).
  Can somebody help with this?</p>