Error note hibernate appears xxx is not mapped[from xxx where ...] Reasons for troubleshooting

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.