title: EntityManager.find(MyClass.class, id) returns null
body: <p>My entitymanager.find() gives nullpointerexception, there is a row in the database with the id provided.</p>
  
  <pre><code>@Entity
  public class ForumCategory implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private Long id;
  @Column (name="title")
  private String title;
  @Column (name="datecreated")
  private Date created;
  @Column (name="dateupdated")
  private Date updated;  
  @Column (name="createdby")
  private String createdBy;
  @OneToMany(mappedBy="category")
  private Set&lt;ForumThread&gt; threads;
  </code></pre>
  
  <p>this is the find method</p>
  
  <pre><code>public ForumCategory find(Long id) {
      ForumCategory category = em.find(ForumCategory.class, id);
      return category;
  }
  </code></pre>
  
  <p>i have tried using but still error.</p>
  
  <pre><code>em.createQuery("SELECT obj FROM ForumCategory obj WHERE obj.id=1")
  </code></pre>
  
  <p>i am using MySqlWorkbench and when i run "select * from forumcategory where id=1" it returns the correct row.</p>