Hibernate Configuration29 Aug 2024 | 3 min read As Hibernate can operate in different environments, it requires a wide range of configuration parameters. These configurations contain the mapping information that provides different functionalities to Java classes. Generally, we provide database related mappings in the configuration file. Hibernate facilitates to provide the configurations either in an XML file (like hibernate.cfg.xml) or properties file (like hibernate.properties). An instance of Configuration class allows specifying properties and mappings to applications. This class also builds an immutable SessionFactory. We can acquire the Configuration class instance by instantiating it directly and specifying mappings in the configuration file. Use the addResource() method, if the mapping files are present in the classpath. Let's see an example to provide the configurations in XML file and properties file. XML Based Configuration Properties File Configuration Properties of Hibernate ConfigurationHibernate JDBC Properties
Hibernate Datasource Properties
Hibernate Configuration Properties
Hibernate Cache Properties
Hibernate Transaction Properties
Other Hibernate Properties
Next TopicHibernate Tutorial |
We request you to subscribe our newsletter for upcoming updates.