Update/delete queries cannot be typed JPA
The declaration of the EntityManager
methods are the following:
Query createQuery(java.lang.String qlString)
<T> TypedQuery<T> createQuery(java.lang.String qlString, java.lang.Class<T> resultClass)
// The other three method is not relevant here
From this, you can clearly see, that you get a TypedQuery<T>
because of the second parameter. If you remove it, you will get a simple Query
object. That is what you need.
Try removing the TrainingEntry.class
argument when calling createQuery(), since this is what makes it a "typed" query.