Description: org.hibernate.hql.ast.QuerySyntaxException: Tablename is not mapped [SELECT id
FROM Tablename] when trying to run NamedQuery in JPA.
Reason/Solution: Put simply, you are using the table name instead of the Entity class name mapped in persistence.xml.
So if table USERS is mapped to entity class User, your query will need User and not USERS.
FROM Tablename] when trying to run NamedQuery in JPA.
Reason/Solution: Put simply, you are using the table name instead of the Entity class name mapped in persistence.xml.
So if table USERS is mapped to entity class User, your query will need User and not USERS.
No comments:
Post a Comment