nicholas
nicholas

Reputation: 2762

CreateNamedQuery Null Pointer Exception

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.

Upvotes: 0

Views: 1678

Answers (1)

aniri
aniri

Reputation: 1831

Check the docs on how to use the createNamedQuery method. You should replace "QueryName" with an actual query..

Upvotes: 1

Related Questions