Hibernate Configurations Tables
Hibernate JDBC properties
| Property Name | Purpose |
|---|---|
| hibernate.connection.driver_class | JDBC driver class |
| hibernate.connection.url | JDBC URL |
| hibernate.connection.username | database user |
| hibernate.connection.password | database user password |
| hibernate.connection.pool_size | maximum number of pooled connection |
Hibernate DataSource properties
| Property Name | Purpose |
|---|---|
| hibernate.connection.driver_class | JDBC driver class |
| hibernate.connection.url | JDBC URL |
| hibernate.connection.username | database user |
| hibernate.connection.password | database user password |
| hibernate.connection.pool_size | maximum number of pooled connection |
Hibernate Configuration properties
| Property Name | Purpose |
|---|---|
| hibernate.dialect | The classname of Hibernate org.hibernate.dialect.Dialect which allows Hibernate to genarate SQL optimized for a particular relational databases. eg. full.classname.of.Dialect |
| hibernate.show_sql | Write all SQL statements to console. This is an alternative to setting the log category org.hibernate.SQL to debug. eg. treu | false |
| hibernate.format_sql | preety print the SQL in the log and console eg. true | false |
| hibernate.default_schema | Qualify unqualified table names with the given schema/ tablespace in generated SQL eg. SCHEMA_NAME |
| hibernate.default_catalog | Qualifies unqualified table names with the given catalog in generated SQL eg. CATALOG_NAME |
| hibernate.session_factory_name | The org.hibernate.SessionFactory will be automatically bound to this name in JNDI after it has been created. eg. jndi/composite/name |
| hibernate.max_fetch_depth | Sets a maximum "depth" for the outer join fetch tree for single-ended associations (one-to-one, many-to-many). A o disables default outer join fetching. eg. recommended values between 0 and 3 |
| hibernate.default_batch_size | Sets a default size for Hibernate batch fetching of associations. eg. recommended values 4,8,16 |
Hibernate JDBC and Connection properties
| Property Name | Purpose |
|---|---|
| hibernate.jdbc.batch_size | A non-zero value determines the JDBC fetch size (calls Statement.setFetchSize()). |
| hibernate.jdbc.batch_size | A non-zero value determines the JDBC2 batch updates by Hibernate. eg. recommended values between 5 and 30 |
| hibernate.jdbc.batch_versioned_data | Set this property to true if your JDBC driver returns correct row counts from executeBatch(). It is usually safe to turn this option on. Hibernate will then use batched DML for automatically versioned data. Default to false. eg. true | false |
Hibernate Cache properties
| Property Name | Purpose |
|---|---|
| hibernate.cache.provider_class | The classname of a custom CacheProvider. eg. classname.of.CacheProvider |
| hibernate.cache.use_minimal_puts | Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads. This setting is most useful for clustered caches and, in Hibernate3, is enabled by default for clustered cache implementationseg. true | false |
| hibernate.cache.use_query_cache | Enables the query cache. individual queries still have to be set cachable. eg. true | false |
| hibernate.cache.use_second_level_cache | Can be used to completely disable the second level cache. which is enabled by default for classes which specify a <cache> mapping. eg. true | false |
| hibernate.cache.query_cache_factory | The classname of a custom QueryCache interface, defaults to the built-in StandardQueryCache. eg. classname.of.QueryCache. |
| hibernate.cache.region_prefix | A prefix to use for second-level cache region names. eg.prefix |
| hibernate.cache.use_structured_entries | Forces Hibernate to store data in th structured form which is more human friendly formateg. true | false |
Hibernate Transaction properties
| Property Name | Purpose |
|---|---|
| hibernate.transaction.factory_class | The classname of a transactionFactory to use with Hibernate Transaction API (defaults to JDBCTransactionFactory). eg. classname.of.TransactionFactory |
| jta.UserTransaction | A JNDI name used by JTATransactionFactory to obtain the JTA UserTransaction from the application server.eg. jndi/composite/name |
| hibernate.transaction. manager_lookup_class | The classname of a TransactionManagerLookup. It is required when JVM-level caching is enabled or when using hilo generator in a JTA environment.eg. classname.of.TransactionManagerLookup |
| hibernate.transaction. flush_before_completion | If enabled, the session will be automatically flushed during the before completion phase of the transaction. Built-in and automatic session context management is preffered. eg. true | false |
| hibernate.transaction.auto_close_session | If enabled, the session will be automatically closed during the after completion phase of the transaction. Built-in and automatic session context management is preffered. eg. classname.of.QueryCache. |
| hibernate.cache.region_prefix | A prefix to use for second-level cache region names. eg.prefix |
| hibernate.cache.use_structured_entries | Forces Hibernate to store data in th structured form which is more human friendly formateg. true | false |
Miscelleneous properties
| Property Name | Purpose |
|---|---|
| hibernate_current_ session_context_class | Supply a custom strategy for the scoping of the "current" Sessioneg. jta|thread|managed|custom.Class |
| hibernate.query.factor_class | Chooses the HQl parser implementation eg. org.hibernate.hql.ast.ASTQueryTranslatorFactory. or org.hibernate.hql.ClassicQueryTranslatorFactory. |
| hibernate.query.substitutions | Is used to map from tokens in Hibernate queries to SQL tokens (tokens might be function or literal names)eg. hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC |
| hibernate.hbm2ddl.auto | Automatically validates or exports schema DDL to the Database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.eg. validate | update | create | create-drop |
| hibernate.cglib. use_reflection_optimizer | Enables the use of CGLIB instead of runtime reflection( System-level property). Reflection can sometimes be useful when troubleshooting. Hibernate always reuires CGLIB even if you turn off the optimizer. You cannot set this property in hibernate.cfg.xml. eg. true | false |


