I have a Spring project for a small web app set up in Intellij IDEA.
It uses JPA on top of Hibernate for the persistence layer. The datasource (MySQL) is defined in
There are a few things you need to do. First, configure a Hibernate facet in your Project Structure configuration. You can select your Hibernate configuration file at this point or create a new one. You should then configure your data sources in the Database window (View->Tools Window->Database). Remember to set the database dialect on the Console tab in the database window. Finally, you need to go to the Persistence window (View->Tools Window->Persistence) and add a data source to the appropriate facet. Just right click on the right icon in the tree and select "Add Datasource". The Data Source column has a drop down menu containing all the data sources you have configured. IntelliJ then correctly identifies the tables.
One word of warning. As of v12.04, IntelliJ does not modify your Hibernate configuration file. You still need to map your classes and manually add your database details.