Home > Back-end >  How table to hibernate build table problem
How table to hibernate build table problem

Time:10-07

This is the company table mapping

Table="t_company" & gt;









This is the staff table mapping

Table="t_staff" & gt;










This is the core configuration file


. Com. Mysql. JDBC Driver

JDBC: mysql:///hibernate_day03





The update of the meaning is if the table is updated already exists, no the new
- & gt;

Org. Hibernate. The dialect. MySQLDialect

Thread






This is the exception table test built

Under Caused by: org. Hibernate. MappingException: An association from the table t_staff refers to An unmapped class: com.tangizyi.entity.Com pany
The at org. Hibernate. Boot. Internal. InFlightMetadataCollectorImpl. SecondPassCompileForeignKeys (InFlightMetadataCollectorImpl. Java: 1838)
The at org. Hibernate. Boot. Internal. InFlightMetadataCollectorImpl. SecondPassCompileForeignKeys (InFlightMetadataCollectorImpl. Java: 1809)
The at org. Hibernate. Boot. Internal. InFlightMetadataCollectorImpl. ProcessSecondPasses (InFlightMetadataCollectorImpl. Java: 1627)
At org.hibernate.boot.model.process.spi.MetadataBuildingProcess.com plete MetadataBuildingProcess. Java: (278)
At org. Hibernate. Boot. Model. The process. The spi. MetadataBuildingProcess. Build (83) MetadataBuildingProcess. Java:
The at org. Hibernate. Boot. Internal. MetadataBuilderImpl. Build (MetadataBuilderImpl. Java: 418)
The at org. Hibernate. Boot. Internal. MetadataBuilderImpl. Build (MetadataBuilderImpl. Java: 87)
At org. Hibernate. CFG. Configuration. BuildSessionFactory (692) Configuration. Java:
At org. Hibernate. CFG. Configuration. BuildSessionFactory (724) Configuration. Java:
At com. Tangziyi. Utils. HibernateUtils. & lt; Clinit> (HibernateUtils. Java: 21)




The full path, the full name of the class check the countless times no problem, just can't find the problem where, o great god to look at it
  • Related