I have a weird problem with my Java code.
I am facing the following exception:
java.lang.IllegalArgumentException: Not an entity: class
Note that I have a persistence.xml where my entites are listed. My entites have @Entity annotation.
When I do:
final Query q = entityManager.createQuery("from " + className + " c");
q.getResultList().iterator();
it returns me results.
But when I do:
// pType is Class<T>
final TypedQuery<T> queryAll = entityManager.createQuery(query.select(query.from(pType)));
return queryAll.getResultList();
it returns me the Exception above.
Do you have an idea?