Hibernate.orgCommunity Documentation
hibernate.dialect | A fully-qualified classname |
The classname of a Hibernate
In most cases Hibernate can choose the correct |
hibernate.show_sql |
| Write all SQL statements to the console. This is an alternative to setting the log category org.hibernate.SQL to debug. |
hibernate.format_sql |
| Pretty-print the SQL in the log and console. |
hibernate.default_schema | A schema name | Qualify unqualified table names with the given schema or tablespace in generated SQL. |
hibernate.default_catalog | A catalog name | Qualifies unqualified table names with the given catalog in generated SQL. |
hibernate.session_factory_name | A JNDI name | The org.hibernate.SessionFactory is automatically bound to this name in JNDI
after it is created. |
hibernate.max_fetch_depth | A value between 0 and 3 | Sets a maximum depth for the outer join fetch tree for single-ended associations. A single-ended
assocation is a one-to-one or many-to-one assocation. A value of 0 disables default outer
join fetching. |
hibernate.default_batch_fetch_size |
| Default size for Hibernate batch fetching of associations. |
hibernate.default_entity_mode | One of | Default mode for entity representation for all sessions opened from this
SessionFactory |
hibernate.order_updates |
| Forces Hibernate to order SQL updates by the primary key value of the items being updated. This reduces the likelihood of transaction deadlocks in highly-concurrent systems. |
hibernate.generate_statistics |
| Causes Hibernate to collect statistics for performance tuning. |
hibernate.use_identifier_rollback |
| If true, generated identifier properties are reset to default values when objects are deleted. |
hibernate.use_sql_comments |
| If true, Hibernate generates comments inside the SQL, for easier debugging. |
Table A.1. JDBC properties
Property | Example | Purpose |
---|---|---|
hibernate.jdbc.fetch_size | 0 or an integer | A non-zero value determines the JDBC fetch size, by calling
Statement.setFetchSize() . |
hibernate.jdbc.batch_size | A value between | A non-zero value causes Hibernate to use JDBC2 batch updates. |
hibernate.jdbc.batch_versioned_data |
| Set this property to |
hibernate.jdbc.factory_class | The fully-qualified class name of the factory | Select a custom |
hibernate.jdbc.use_scrollable_resultset |
| Enables Hibernate to use JDBC2 scrollable resultsets. This property is only relevant for user-supplied JDBC connections. Otherwise, Hibernate uses connection metadata. |
hibernate.jdbc.use_streams_for_binary |
| Use streams when writing or reading binary or serializable types to or from JDBC. This is a system-level property. |
hibernate.jdbc.use_get_generated_keys |
| Allows Hibernate to use JDBC3 |
Table A.2. Cache Properties
Property | Example | Purpose |
---|---|---|
hibernate.cache.provider_class | Fully-qualified classname | The classname of a custom CacheProvider. |
hibernate.cache.use_minimal_puts |
| Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads. This is most useful for clustered caches and is enabled by default for clustered cache implementations. |
hibernate.cache.use_query_cache |
| Enables the query cache. You still need to set individual queries to be cachable. |
hibernate.cache.use_second_level_cache |
| Completely disable the second level cache, which is enabled by default for classes which specify a <cache> mapping. |
hibernate.cache.query_cache_factory | Fully-qualified classname | A custom QueryCache interface. The default is the built-in
StandardQueryCache . |
hibernate.cache.region_prefix | A string | A prefix for second-level cache region names. |
hibernate.cache.use_structured_entries |
| Forces Hibernate to store data in the second-level cache in a more human-readable format. |
Table A.3. Transactions properties
Property | Example | Purpose |
---|---|---|
hibernate.transaction.factory_class | A fully-qualified classname | The classname of a TransactionFactory to use with Hibernate Transaction API. The
default is JDBCTransactionFactory ). |
jta.UserTransaction | A JNDI name | The |
hibernate.transaction.manager_lookup_class | A fully-qualified classname | The classname of a |
hibernate.transaction.flush_before_completion |
| Causes the session be flushed during the before completion phase of the transaction. If possible, use built-in and automatic session context management instead. |
hibernate.transaction.auto_close_session |
| Causes the session to be closed during the after completion phase of the transaction. If possible, use built-in and automatic session context management instead. |
Each of the properties in the following table are prefixed by hibernate.
. It has been removed
in the table to conserve space.
Table A.4. Miscellaneous properties
Property | Example | Purpose |
---|---|---|
current_session_context_class | One of | Supply a custom strategy for the scoping of the |
factory_class |
| Chooses the HQL parser implementation. |
query.substitutions |
| Map from tokens in Hibernate queries to SQL tokens, such as function or literal names. |
hbm2ddl.auto |
| Validates or exports schema DDL to the database when the SessionFactory is
created. With create-drop , the database schema is dropped when the
SessionFactory is closed explicitly. |
cglib.use_reflection_optimizer |
| If enabled, Hibernate uses CGLIB instead of runtime reflection. This is a system-level property. Reflection is useful for troubleshooting. Hibernate always requires CGLIB even if you disable the optimizer. You cannot set this property in hibernate.cfg.xml. |
c3p0 connection pool properties
hibernate.c3p0.min_size
hibernate.c3p0.max_size
hibernate.c3p0.timeout
hibernate.c3p0.max_statements
Table A.5. Proxool connection pool properties
Property | Description |
---|---|
hibernate.proxool.xml | Configure Proxool provider using an XML file (.xml is appended automatically) |
hibernate.proxool.properties | Configure the Proxool provider using a properties file (.properties is appended automatically) |
hibernate.proxool.existing_pool | Whether to configure the Proxool provider from an existing pool |
hibernate.proxool.pool_alias | Proxool pool alias to use. Required. |
For information on specific configuration of Proxool, refer to the Proxool documentation available from http://proxool.sourceforge.net/.
Copyright © 2011 Red Hat, Inc.