IntelliJ IDEA 2016.1 Help

Creating hibernate.cfg.xml

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

  1. In the Project tool window, right-click the desired module and select Open Module Settings.
  2. In the Project Structure dialog that opens, under the module node, click Hibernate.
  3. In the Descriptors section, click add (Alt+Insert) and select hibernate.cfg.xml.
  4. In the dialog that opens, specify the file location and name, and select its version.
  5. Click OK in the Project Structure dialog.

Creating hibernate.cfg.xml in the Persistence tool window

  1. Open the Persistence tool window (e.g. View | Tool Windows | Persistence).
  2. Right-click your module, select New, and select Session Factory.
  3. In the dialog that opens, click icon_newXmlFile.png to create a new file.
  4. Specify the name of the file (hibernate.cfg.xml).

See Also

Last modified: 13 July 2016