Associating existing Hibernate mapping files with classes

I have an existing project with all the mappings defined but when I add the Hibernate Facet their is no association linked between the mappings and the classes. I tried creating a datasource (although it is not connected to a db)  and created a default hibernate.cfg.xml file and linking it to the datasource but this did not resolve the problem. This was the only steps I needed when configuring JPA for an existing project.

Any ideas? Thanks


How are the mappings configured in the application itself? Don't you have a top-level hibernate.cfg.xml that pulls all of them together?
Note that IDEA can also extract the required information from a typical Spring/Hibernate LocalSessionFactoryBean bean declaration - you do need to configure a Spring facet for that.


No there doesn't appear to be any hibernate.cfg.xml. It's a new project with a ton of legacy code I have just been thrown into. I haven't worked much with Hibernate using the mappings. I have tried several ways to get idea to recognize the associations but haven't been able so far.


Please sign in to leave a comment.