Ce contenu n'est pas disponible dans la langue sélectionnée.
Appendix A. Reference Material
A.1. Hibernate Properties
Property Name | Value | Description |
---|---|---|
|
| The class name of the JDBC driver to be used. |
| sa | The username. |
| The password. | |
|
| The JDBC connection URL. |
Property Name | Description |
---|---|
hibernate.dialect |
The class name of a Hibernate
In most cases Hibernate will be able to choose the correct |
hibernate.show_sql |
Boolean. Writes all SQL statements to console. This is an alternative to setting the log category |
hibernate.format_sql | Boolean. Pretty print the SQL in the log and console. |
hibernate.default_schema | Qualify unqualified table names with the given schema/tablespace in generated SQL. |
hibernate.default_catalog | Qualifies unqualified table names with the given catalog in generated SQL. |
hibernate.session_factory_name |
The org.hibernate.SessionFactory will be automatically bound to this name in JNDI after it has been created. For example, |
hibernate.max_fetch_depth |
Sets a maximum depth for the outer join fetch tree for single-ended associations (one-to-one, many-to-one). A |
hibernate.default_batch_fetch_size |
Sets a default size for Hibernate batch fetching of associations. The recommended values are |
hibernate.default_entity_mode |
Sets a default mode for entity representation for all sessions opened from this |
hibernate.order_updates | Boolean. Forces Hibernate to order SQL updates by the primary key value of the items being updated. This will result in fewer transaction deadlocks in highly concurrent systems. |
hibernate.generate_statistics | Boolean. If enabled, Hibernate will collect statistics useful for performance tuning. |
hibernate.use_identifier_rollback | Boolean. If enabled, generated identifier properties will be reset to default values when objects are deleted. |
hibernate.use_sql_comments |
Boolean. If turned on, Hibernate will generate comments inside the SQL, for easier debugging. Default value is |
hibernate.id.new_generator_mappings |
Boolean. This property is relevant when using @GeneratedValue. It indicates whether or not the new IdentifierGenerator implementations are used for javax.persistence.GenerationType.AUTO, javax.persistence.GenerationType.TABLE and javax.persistence.GenerationType.SEQUENCE. Default value is |
hibernate.ejb.naming_strategy |
Chooses the org.hibernate.cfg.NamingStrategy implementation when using Hibernate EntityManager. If the application does not use EntityManager, follow the instructions here to configure the NamingStrategy: Hibernate Reference Documentation - Naming Strategies.
For an example on native bootstrapping using MetadataBuilder and applying the implicit naming strategy, see http://docs.jboss.org/hibernate/orm/5.0/userguide/html_single/Hibernate_User_Guide.html#bootstrap-native-metadata in the Hibernate 5.0 documentation. The physical naming strategy can be applied by using |
hibernate.implicit_naming_strategy |
Specifies the
The default setting is defined by the |
hibernate.physical_naming_strategy |
Pluggable strategy contract for applying physical naming rules for database object names. Specifies the PhysicalNamingStrategy class to be used. |
For hibernate.id.new_generator_mappings
, new applications should keep the default value of true
. Existing applications that used Hibernate 3.3.x may need to change it to false
to continue using a sequence object or table based generator, and maintain backward compatibility.
Property Name | Description |
---|---|
hibernate.jdbc.fetch_size |
A non-zero value that determines the JDBC fetch size (calls |
hibernate.jdbc.batch_size |
A non-zero value enables use of JDBC2 batch updates by Hibernate. The recommended values are between |
hibernate.jdbc.batch_versioned_data |
Boolean. Set this property to |
hibernate.jdbc.factory_class | Select a custom org.hibernate.jdbc.Batcher. Most applications will not need this configuration property. |
hibernate.jdbc.use_scrollable_resultset | Boolean. Enables use of JDBC2 scrollable resultsets by Hibernate. This property is only necessary when using user-supplied JDBC connections. Hibernate uses connection metadata otherwise. |
hibernate.jdbc.use_streams_for_binary |
Boolean. This is a system-level property. Use streams when writing/reading |
hibernate.jdbc.use_get_generated_keys |
Boolean. Enables use of JDBC3 |
hibernate.connection.provider_class | The class name of a custom org.hibernate.connection.ConnectionProvider which provides JDBC connections to Hibernate. |
hibernate.connection.isolation |
Sets the JDBC transaction isolation level. Check java.sql.Connection for meaningful values, but note that most databases do not support all isolation levels and some define additional, non-standard isolations. Standard values are |
hibernate.connection.autocommit | Boolean. This property is not recommended for use. Enables autocommit for JDBC pooled connections. |
hibernate.connection.release_mode |
Specifies when Hibernate should release JDBC connections. By default, a JDBC connection is held until the session is explicitly closed or disconnected. The default value auto will choose
Available values are auto (default), on_close,
This setting only affects the session returned from |
hibernate.connection.<propertyName> |
Pass the JDBC property <propertyName> to |
hibernate.jndi.<propertyName> |
Pass the property <propertyName> to the JNDI |
Property Name | Description |
---|---|
|
The class name of a custom |
| Boolean. 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 implementations. |
| Boolean. Enables the query cache. Individual queries still have to be set cacheable. |
|
Boolean. Used to completely disable the second level cache, which is enabled by default for classes that specify a |
|
The class name of a custom |
| A prefix to use for second-level cache region names. |
| Boolean. Forces Hibernate to store data in the second-level cache in a more human-friendly format. |
|
Setting used to give the name of the default org.hibernate.annotations.CacheConcurrencyStrategy to use when either @Cacheable or @Cache is used. |
Property Name | Description |
---|---|
|
The classname of a |
|
A JNDI name used by |
|
The classname of a |
| Boolean. If enabled, the session will be automatically flushed during the before completion phase of the transaction. Built-in and automatic session context management is preferred. |
| Boolean. If enabled, the session will be automatically closed during the after completion phase of the transaction. Built-in and automatic session context management is preferred. |
Property Name | Description |
---|---|
|
Supply a custom strategy for the scoping of the "current" |
|
Chooses the HQL parser implementation: |
|
Used to map from tokens in Hibernate queries to SQL tokens (tokens might be function or literal names). For example, |
|
Indicates whether the Java constants follow the Java naming conventions or not. Default is
Setting this to
When this property is set to |
|
Automatically validates or exports schema DDL to the database when the |
|
Comma-separated names of the optional files containing SQL DML statements executed during the SessionFactory creation. This is useful for testing or demonstrating. For example, by adding INSERT statements, the database can be populated with a minimal set of data when it is deployed. An example value is
File order matters, as the statements of a given file are executed before the statements of the following files. These statements are only executed if the schema is created, for example if |
| The classname of a custom ImportSqlCommandExtractor. Defaults to the built-in SingleLineSqlCommandExtractor. This is useful for implementing a dedicated parser that extracts a single SQL statement from each import file. Hibernate also provides MultipleLinesSqlCommandExtractor, which supports instructions/comments and quoted strings spread over multiple lines (mandatory semicolon at the end of each statement). |
|
Boolean. This is a system-level property, which cannot be set in the |
|
Both javassist or cglib can be used as byte manipulation engines. The default is |
RDBMS | Dialect |
---|---|
DB2 |
|
DB2 AS/400 |
|
DB2 OS390 |
|
Firebird |
|
FrontBase |
|
H2 Database |
|
HypersonicSQL |
|
Informix |
|
Ingres |
|
Interbase |
|
MariaDB 10 |
|
MariaDB Galera Cluster 10 |
|
Mckoi SQL |
|
Microsoft SQL Server 2000 |
|
Microsoft SQL Server 2005 |
|
Microsoft SQL Server 2008 |
|
Microsoft SQL Server 2012 |
|
Microsoft SQL Server 2014 |
|
Microsoft SQL Server 2016 |
|
MySQL5 |
|
MySQL5.7 |
|
MySQL5 with InnoDB |
|
MySQL with MyISAM |
|
Oracle (any version) |
|
Oracle 9i |
|
Oracle 10g |
|
Oracle 11g |
|
Oracle 12c |
|
Pointbase |
|
PostgreSQL |
|
PostgreSQL 9.2 |
|
PostgreSQL 9.3 |
|
PostgreSQL 9.4 |
|
Postgres Plus Advanced Server |
|
Progress |
|
SAP DB |
|
Sybase |
|
Sybase 15.7 |
|
Sybase 16 |
|
Sybase Anywhere |
|
The hibernate.dialect
property should be set to the correct org.hibernate.dialect.Dialect
subclass for the application database. If a dialect is specified, Hibernate will use sensible defaults for some of the other properties. This means that they do not have to be specified manually.
Revised on 2018-10-11 12:31:18 UTC