title: Hibernate criteria for difference between 2 columns
body: <p>I have a trivial hibernate entity with 2 fields - <code>a</code> and <code>b</code>:<br/></p>
  
  <pre><code>@Entity
  public class PlayerEntity {
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Integer id;
  
      @Column(nullable = false)
      private Integer a;
  
      @Column(nullable = false)
      private Integer b;
  }
  </code></pre>
  
  <p><br/>
  I need to select all the players where <code>a - b &gt; 5</code>.<br/>
  Can this be ever done using standard Hibernate Criteria API? Can I somehow <strong>avoid using SQL/HQL</strong> for this rather typical condition?<br/>
  Thanks!</p>