I have the following code :
TypedQuery<Employee> query = em.createNamedQuery("QueryName", Employee.class);
which result the null pointer exception at hibernate.
Do anyone know why?
Below is the stack trace:
java.lang.NullPointerException
at org.hibernate,internal.SessionFactoryImpl.getReturnTypes();
at org.hibernate.internal.AbstractQueryImpl.getReturnTypes();
Please help.
Thanks.
Check the docs on how to use the createNamedQuery method. You should replace “QueryName” with an actual query..