org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped

Finally I found a mistake! Hope this is useful to someone. When doing a request to the database(in my case it Apache Derby), name of base need write the first letter upper case other in lower case.

This is wrong query:

session.createQuery("select first_name from CUSTOMERV").

This is valid query

session.createQuery("select first_name from Customerv"). 

And class entity must be same name as database, but I'm not sure.


in HQL query, Don't write the Table name, write your Entity class name in your query like

String s = "from Entity_class name";
query qry = session.createUqery(s);