title: How to write JPA query with boolean condition
body: <p>In my project i am using JPA 2.0 with eclipselink inplementation, an I have following problem:</p>
  
  <p>I have defined entity with boolean column:</p>
  
  <pre><code>@Entity
  public User {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name="USR_ID")
      private Short id;
  
      @Column(name="USR_NAME")
      private String name;
  
      @Column(name="USR_ACTIVE")
      private boolean active;
  
      .......
  
  }
  </code></pre>
  
  <p>I want to create query which will return all active users, something like this:</p>
  
  <p><em>select u from User u where u.active = TRUE;</em></p>
  
  <p>But if I use that query I got exception that boolean can't be cast to Short (column in database is stored as smallint). Is there any correct way how to write this query?</p>
  
  <p>Thanks</p>