IntelliJ IDEA 14.0.3 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.
    hibernateAddSessionFactory2.png
  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.
    hibernateAddSessionFactory1.png
  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: 3 February 2015
comments powered by Disqus