Org. hibernate. MappingException: An association from the table order_intem_inf refers to a unmapped, unmapped

Source: Internet
Author: User

Org. hibernate. MappingException: An association from the table order_intem_inf refers to a unmapped, unmapped

The following error message is displayed when running a HIbernate example:

Exception in thread "main" java. lang. ExceptionInInitializerError
At com. hibernate. utils. HibernateUtil. <clinit> (HibernateUtil. java: 21)
At org. hibernate. samples. PersonManager. main (PersonManager. java: 23)
Caused by: org. hibernate. MappingException: An association from the table order_intem_inf refers to an unmapped class: Product
At org. hibernate. cfg. Configuration. secondPassCompileForeignKeys (Configuration. java: 1805)
At org. hibernate. cfg. Configuration. originalSecondPassCompile (Configuration. java: 1739)
At org. hibernate. cfg. Configuration. secondPassCompile (Configuration. java: 1424)
At org. hibernate. cfg. Configuration. buildSessionFactory (Configuration. java: 1844)
At org. hibernate. cfg. Configuration. buildSessionFactory (Configuration. java: 1928)
At com. hibernate. utils. HibernateUtil. <clinit> (HibernateUtil. java: 16)
... 1 more

From the error information, we can see that the class Product is not mapped to, but the Product is clearly. hbm. the xml file exists, and the mapping information is filled in. Later, the check found that only "Product" rather than the complete path name is written in another reference place.




Hibernate ing Error

The prompt is clear.
An association from the table t_InStorageRecords refers to an unmapped class: com. hsh. hhoa. entity. MemberInfo

The configuration of the com. hsh. hhoa. entity. MemberInfo class is incorrect. Hibernate does not find its configuration information.

Hibernate error explanation, instruction ,,,

Does your model class contain int-type member variables? Try changing the int type to Integer.

Related Article

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.