If you don't have the Hibernate configuration file hibernate.cfg.xml yet,
you can create that file using the Project Structure dialog or
the Persistence tool window.
- Creating hibernate.cfg.xml in the Project Structure dialog
- Creating hibernate.cfg.xml in the Persistence tool window
- In the Project tool window, right-click the desired module and select Open Module Settings.
-
In the Project Structure dialog that opens,
under the module node, click Hibernate.

- In the Descriptors section, click
(Alt+Insert) and
select . - In the dialog that opens, specify the file location and name, and select its version.
- Click OK in the Project Structure dialog.
- Open the Persistence tool window (e.g. ).
- Right-click your module, select New, and select Session Factory.

- In the dialog that opens, click
to create a new file. - Specify the name of the file (
hibernate.cfg.xml).