Hibernate @ManyToOne references an unknown entity

前端 未结 12 1345
名媛妹妹
名媛妹妹 2021-01-03 17:54

I am receiving the following Hibernate Exception:

@OneToOne or @ManyToOne on Matchup.awayTeam references an unknown entity: Team

The simplified

12条回答
  •  执念已碎
    2021-01-03 18:08

    I work in a project using Spring and Hibernate 4 and I found out that we do not have a hibernate.cfg.xml file. Instead, our beans are listed in the file applicationContext.xml which looks a bit like

    
        
            
        
        
            
                com.package.Bean
            
        
    
    

    Adding my bean to the list solved the problem. You can find some more information here.

提交回复
热议问题