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

This exception is that the hql statement is wrong, the hql in hibernate is not sql, the difference is that the table name after from is not the table name in the database, but the name of the entity class .

entity class

Here the table name is mapped to the database is voucher, but the entity class name is Voucher, pay attention to case

The error here is using the database table name voucher instead of the entity class name Voucher! !

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324377829&siteId=291194637