> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/spring/spring-features/spring-persistence/jpa-implementation/hibernate/properties.md). Agents can also search and read this documentation through its [MCP server](https://www.pranaypourkar.co.in/the-programmers-guide/~gitbook/mcp).

# Properties

Hibernate 6.4 supports a range of configuration properties that can be utilized within Spring Boot applications. Below is a categorized list of some commonly used properties:​

## **General Settings**

* **`hibernate.dialect`**: Specifies the SQL dialect.
  * Example: `org.hibernate.dialect.MySQL8Dialect`​
* **`hibernate.show_sql`**: Enables logging of SQL statements.
  * Example: `true`​
* **`hibernate.format_sql`**: Formats the SQL statements in the log.
  * Example: `true`
* **`hibernate.hbm2ddl.auto`**: Controls the automatic schema generation.
  * Options: `validate`, `update`, `create`, `create-drop`, `none`​

## **JDBC and Connection Settings**

* **`hibernate.connection.driver_class`**: JDBC driver class.
  * Example: `com.mysql.cj.jdbc.Driver`​
* **`hibernate.connection.url`**: JDBC connection URL.
  * Example: `jdbc:mysql://localhost:3306/yourdb`​
* **`hibernate.connection.username`**: Database username.
  * Example: `root`​
* **`hibernate.connection.password`**: Database password.
  * Example: `password`​
* **`hibernate.connection.pool_size`**: Specifies the size of the connection pool.
  * Example: `10`​

## **Caching**

* **`hibernate.cache.use_second_level_cache`**: Enables second-level caching.
  * Example: `true`​
* **`hibernate.cache.region.factory_class`**: Specifies the cache region factory.
  * Example: `org.hibernate.cache.jcache.JCacheRegionFactory`​
* **`hibernate.cache.provider_class`**: Specifies the cache provider class.
  * Example: `org.ehcache.jsr107.EhcacheCachingProvider`​

## **Batch Processing**

* **`hibernate.jdbc.batch_size`**: Defines the batch size for JDBC batch updates.
  * Example: `30`​
* **`hibernate.order_inserts`**: Orders insert statements for batch processing.
  * Example: `true`​
* **`hibernate.order_updates`**: Orders update statements for batch processing.
  * Example: `true`​

## **Logging and Statistics**

* **`hibernate.generate_statistics`**: Enables generation of statistics.
  * Example: `true`​
* **`hibernate.use_sql_comments`**: Adds comments to SQL statements.
  * Example: `true`​

```properties
spring.jpa.show-sql: true  # Prints SQL queries generated by JPA to the console.
spring.jpa.properties.hibernate.show_sql: true  # Ensures Hibernate also logs SQL statements (similar to above, sometimes needed for consistency).
spring.jpa.properties.hibernate.format_sql: true  # Formats the SQL output for better readability.
spring.jpa.properties.hibernate.type: TRACE  # Logs the SQL data types used in queries at TRACE level.
logging.level.org.hibernate.type.descriptor.sql.BasicBinder: TRACE  # Logs the binding of values to SQL query parameters (e.g., ? placeholders).
logging.level.org.hibernate.orm.jdbc.bind: TRACE  # Logs JDBC bind parameter values, useful for debugging actual data being sent to DB.
```

## **Multi-Tenancy**

* **`hibernate.multiTenancy`**: Specifies the multi-tenancy strategy.
  * Options: `NONE`, `DATABASE`, `SCHEMA`, `DISCRIMINATOR`​
* **`hibernate.tenant_identifier_resolver`**: Specifies the tenant identifier resolver class.
  * Example: `com.example.TenantIdentifierResolver`​

## **Envers (Auditing)**

* **`org.hibernate.envers.audit_table_suffix`**: Suffix for audit tables.
  * Example: `_AUD`​
* **`org.hibernate.envers.revision_field_name`**: Name of the revision field.
  * Example: `REV`​
* **`org.hibernate.envers.revision_type_field_name`**: Name of the revision type field.
  * Example: `REVTYPE`​


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/spring/spring-features/spring-persistence/jpa-implementation/hibernate/properties.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
