The company ran the project, encountered a very strange error, information as follows:
Org.hibernate.hql.internal.ast.QuerySyntaxException:User is isn't mapped [select COUNT (*) from the User u where u.username=? an D u.userpassword=? ]
caused By:org.hibernate.hql.internal.ast.QuerySyntaxException:User is not mapped
There are two types of errors that occur in this scenario:
1, the configuration file is not loaded into Hibernate's entity list
2, the mapping file's fields are inconsistent with the database fields, or the name inconsistency causes
That's the only two cases.
Finally, I found that the configuration of the entity class is not well-equipped, so it solves the problem:
Entity class Header set @Entity (name= "xxx") to change the name of the table is not to set the Name property of the entity annotation, but instead set the Name property of the table annotation, the change effect is as follows: To write this @Entity @Table (name= " xxx "); That's good.
Org.hibernate.hql.internal.ast.QuerySyntaxException:User is not mapped exception handling