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.