Creating a Hibernate configuration file

The Hibernate configuration can be specified in the Hibernate Configuration File (cfg.xml), which has more configuration parameters than the properties file.


Either the properties file or the configuration file can be used to specify the configuration, or both can be used. If both are provided, the configuration file overrides the properties file for the configuration parameters specified in both.

The Hibernate XML configuration file has the following advantages over the properties file:

  • The Hibernate configuration file is more convenient when tuning the Hibernate cache. The Hibernate configuration file has the provision to configure the Hibernate XML Mapping files.
  • For exporting a schema to a database using ...

Get Advanced Java® EE Development with WildFly® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.