1. Check whether the HQL statement you wrote uses the table name of the database instead of the class name of the entity class, such as the database table is USER_TB, and the corresponding Pojo class is Usertb,hql is "from USER_TB where xx=xx", and if so, user_ Change TB to USERTB. If you have the same conditions, use the class property name instead of the table name. HQL uses the class name by default unless you explicitly declare it through an entity (NAME=XXX) in Pojo.
2. Check if there is a LampInfo.hbm.xml to join the configuration file, this is the online view, do not know true or false.
3. This was met by a colleague this afternoon. When he was writing Hibernate's sessionfactory configuration,
The package that should be configured for note scanning: <property name= "Packagestoscan" values= "Pojo package name"/> but he wrote less, and when the project was executed, it also reported the exception of XXX was not mapped.
Therefore, if the previous two reasons are cleared, you can look back to take a good view of the configuration file you write, there is no need to scan the properties of the package is not in the Sessionfactory configuration.
Error note hibernate appears xxx is not mapped[from xxx where ...] Reasons for troubleshooting