title: TypedQuery result incompatible using Hibernate and PlayFramework
body: <p>i'm having this problem when calling this simple method that allows me to get a user by it's Username:</p>
  
  <pre><code>@Entity
  public class User {
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      public Long id;
  
      @Constraints.Required
      public String username;
  
  
      @Constraints.Required
      public String password;
  
  
      public boolean isAdmin;
  
      public static User findById(Long id) {
          return JPA.em().find(User.class, id);
      }
  
      public void update(Long id) {
          this.id = id;
          JPA.em().merge(this);
      }
  
      public void save() {
          JPA.em().persist(this);
      }
  
      public void delete() {
          JPA.em().remove(this);
      }
  
  
      public static User findByUsername(String username) {
          Query query = JPA.em().createQuery("select u from User u where username = :username", User.class);
          query.setParameter("username", username);
          return (User) query.getSingleResult();
      }
  
  }
  </code></pre>
  
  <p>The error arrives at the query creation and it's:</p>
  
  <pre><code>[IllegalArgumentException: Type specified for TypedQuery [models.User] is incompatible with query return type [interface java.util.Map]]
  </code></pre>
  
  <p>I'm using Hibernate and PlayFramework, does anyone knows how to fix this?</p>