IntelliJ IDEA 2016.2 Help

Associating Data Sources with Session Factories and Persistence Units

If you are using JPA or Hibernate,
you may want to associate your data sources with persistence units (in the case of JPA) or
session factories (in the case of Hibernate).
If you do so:

Your source code that references database tables will automatically be validated
against the corresponding data source.

When using the JPA or Hibernate console,
you won't need to additionally specify the database connection settings.
The corresponding settings configured for the associated DB data source will automatically be used.

If the persistence units or session factories are generated by importing a database schema,
the association between the corresponding persistence units or session factories and
the data source is set automatically.