You are looking at documentation for an older release. Not what you want? See the current release documentation.
Since 4.3 version, eXo Platform uses Java Persistance API (JPA) to manage relational data and Hibernate as a JPA provider.
In tis section, we will define properties allowing to configure Hibernate in eXo Platform. The following properties should be set in exo.properties file.
Name | Description | Value |
---|---|---|
General configuration | ||
exo.jpa.hibernate.dialect | The classname of a Hibernate org.hibernate.dialect.Dialect | A fully-qualified classname for example for HSQl database it is org.hibernate.dialect.HSQLDialect |
exo.jpa.hibernate.show_sql | Enables/disables log about SQL statements. | true or false |
exo.jpa.hibernate.format_sql | Format log about SQL statements. | true or false |
exo.jpa.hibernate.default_schema | The schema name. | ${gatein.idm.datasource.schema:} |
exo.jpa.hibernate.default_catalog | The catalog name, it qualifies unqualified table names with the given catalog in generated SQL. | |
exo.jpa.hibernate.session_factory_name | The org.hibernate.SessionFactory is automatically bound to this name in JNDI after it is created. | JNDI name |
exo.jpa.hibernate.max_fetch_depth | 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. | A value between 0 and 3 |
exo.jpa.hibernate.default_batch_fetch_size | Default size for Hibernate batch fetching of associations. | 4,8 or 16 |
exo.jpa.hibernate.default_entity_mode | Default mode for entity representation for all sessions opened from this SessionFactory, defaults to pojo. | dynamic-map or pojo |
exo.jpa.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. | true or false |
exo.jpa.hibernate.order_by.default_null_ordering | Defines precedence of null values in ORDER BY clause. Defaults to none which varies between RDBMS implementation. | none, first or last |
exo.jpa.hibernate.generate_statistics | Causes Hibernate to collect statistics for performance tuning. | true or false |
exo.jpa.hibernate.use_identifier_rollback | f true, generated identifier properties are reset to default values when objects are deleted. | true or false |
exo.jpa.hibernate.use_sql_comments | If true, Hibernate generates comments inside the SQL, for easier debugging. | true or false |
Database configuration: JDBC | ||
exo.jpa.hibernate.jdbc.fetch_size | A non-zero value determines the JDBC fetch size, by calling Statement.setFetchSize() . | An integer or 0 |
exo.jpa.hibernate.jdbc.batch_size | A non-zero value causes Hibernate to use JDBC2 batch updates. | A value between 5 and 30 |
exo.jpa.hibernate.jdbc.batch_versioned_data | Set this property to true if your JDBC driver returns correct row counts from executeBatch(). This option is usually safe, but is disabled by default. If enabled, Hibernate uses batched DML for automatically versioned data. | true or false |
exo.jpa.hibernate.jdbc.factory_class | Select a custom org.hibernate.jdbc.Batcher . Irrelevant for most applications. | The fully-qualified class name of the factory |
exo.jpa.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. | true or false |
exo.jpa.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. | true or false |
exo.jpa.hibernate.jdbc.use_get_generated_keys | Allows Hibernate to use JDBC3 PreparedStatement.getGeneratedKeys() to retrieve natively-generated keys after insert.
You need the JDBC3+ driver and JRE1.4+. Disable this property if your driver has problems with the Hibernate identifier generators.
By default, it tries to detect the driver capabilities from connection metadata. | true or false |
Database configuration: Cache properties | ||
exo.jpa.hibernate.cache.provider_class | The classname of a custom CacheProvider. | org.hibernate.cache.HashtableCacheProvider |
exo.jpa.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. | true or false |
exo.jpa.hibernate.cache.use_query_cache | Enables the query cache. You still need to set individual queries to be cachable. | true or false |
exo.jpa.hibernate.cache.use_second_level_cache | Completely disable the second level cache, which is enabled by default for classes which specify a cache mapping. | true or false |
exo.jpa.hibernate.cache.query_cache_factory | A custom QueryCache interface. The default is the built-in StandardQueryCache. | Fully-qualified classname |
exo.jpa.hibernate.cache.region_prefix | A prefix for second-level cache region names. | a string |
exo.jpa.hibernate.cache.use_structured_entries | Forces Hibernate to store data in the second-level cache in a more human-readable format. | true or false |
exo.jpa.hibernate.cache.use_reference_entries | Optimizes second-level cache operation to store immutable entities (aka "reference") which do not have associations into cache directly, this case, lots of disassemble and deep copy operations could be avoided. Default value of this property is false. | true or false |
Database configuration: Transactions properties | ||
exo.jpa.hibernate.transaction.factory_class | The classname of a TransactionFactory to use with Hibernate Transaction API. The default is JDBCTransactionFactory. | org.hibernate.transaction.JTATransactionFactory |
exo.jpa.hibernate.jta.UserTransaction | The JTATransactionFactory needs a JNDI name to obtain the JTA UserTransaction from the application server. | a JNDI name |
exo.jpa.hibernate.transaction.manager_lookup_class | The classname of a TransactionManagerLookup, which is used in conjunction with JVM-level or the hilo generator in a JTA environment. | org.hibernate.transaction.JBossTransactionManagerLookup |
exo.jpa.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. | true or false |
exo.jpa.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. | true or false |
Database configuration: Miscellaneous properties | ||
exo.jpa.current_session_context_class | Supply a custom strategy for the scoping of the Current Session. | jta, thread, managed, or custom.Class |
exo.jpa.factory_class | Chooses the HQL parser implementation. | org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory or org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory |
exo.jpa.query.substitutions | Map from tokens in Hibernate queries to SQL tokens, such as function or literal names. | hqlLiteral=SQL_LITERAL or hqlFunction=SQLFUNC |
exo.jpa.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. | validate, update, create, create-drop |
Connection pool properties | ||
exo.jpa.hibernate.proxool.xml | Configure Proxool provider using an XML file (.xml is appended automatically) | |
exo.jpa.hibernate.proxool.properties | Configure the Proxool provider using a properties file (.properties is appended automatically) | |
exo.jpa.hibernate.proxool.existing_pool | Whether to configure the Proxool provider from an existing pool. | |
exo.jpa.hibernate.proxool.pool_alias | Proxool pool alias to use. Required. |