title: Update/delete queries cannot be typed JPA
body: <p>I'm using the Spring framework for working on training projects. I'm also using JPA and have been having a hell of a time. In my DAO implementation class, I've written:</p>
  
  <pre><code>@Override
  public void deleteEntries(Module mod) {
      System.out.println(mod.getDescription());
      entityManager.createQuery("delete from TrainingEntry e where e.module = :mod and e.completedDate IS NULL",
                                TrainingEntry.class).setParameter("mod", mod);
  
  }
  </code></pre>
  
  <p>As you can see it's just a simple DELETE statement, but I get the error: </p>
  
  <pre><code>"Update/delete queries cannot be typed."
  </code></pre>
  
  <p>My guess is, that I need to use some of the <code>EntityManager</code> class methods to do the job, but I'm not certain, as there's next to nothing about this error online. I'm also having difficulty applying some solutions I've found online about JPA delete queries. Any point in the right direction or explanation as to why this error is thrown is much appreciated. </p>