Provides access to configuration info passed in Properties objects.
Hibernate has two property scopes:
Factory-level properties may be passed to the SessionFactory when it
instantiated. Each instance might have different property values. If no
properties are specified, the factory calls Environment.getProperties().
System-level properties are shared by all factory instances and are always
determined by the Environment properties.
The only system-level properties are
hibernate.jdbc.use_streams_for_binary
hibernate.cglib.use_reflection_optimizer
Environment properties are populated by calling System.getProperties()
and then from a resource named /hibernate.properties if it exists. System
properties override properties specified in hibernate.properties.
The SessionFactory is controlled by the following properties.
Properties may be either be System properties, properties
defined in a resource named /hibernate.properties or an instance of
java.util.Properties passed to
Configuration.buildSessionFactory()
property
meaning
hibernate.dialect
classname of org.hibernate.dialect.Dialect subclass
hibernate.cache.provider_class
classname of org.hibernate.cache.CacheProvider
subclass (if not specified EHCache is used)
hibernate.connection.provider_class
classname of org.hibernate.connection.ConnectionProvider
subclass (if not specified hueristics are used)
hibernate.connection.username
database username
hibernate.connection.password
database password
hibernate.connection.url
JDBC URL (when using java.sql.DriverManager)
hibernate.connection.driver_class
classname of JDBC driver
hibernate.connection.isolation
JDBC transaction isolation level (only when using
java.sql.DriverManager)
hibernate.connection.pool_size
the maximum size of the connection pool (only when using
java.sql.DriverManager)
hibernate.connection.datasource
databasource JNDI name (when using javax.sql.Datasource)
hibernate.jndi.url
JNDI InitialContext URL
hibernate.jndi.class
JNDI InitialContext classname
hibernate.max_fetch_depth
maximum depth of outer join fetching
hibernate.jdbc.batch_size
enable use of JDBC2 batch API for drivers which support it
hibernate.jdbc.fetch_size
set the JDBC fetch size
hibernate.jdbc.use_scrollable_resultset
enable use of JDBC2 scrollable resultsets (you only need this specify
this property when using user supplied connections)
hibernate.jdbc.use_getGeneratedKeys
enable use of JDBC3 PreparedStatement.getGeneratedKeys() to retrieve
natively generated keys after insert. Requires JDBC3+ driver and JRE1.4+
hibernate.hbm2ddl.auto
enable auto DDL export
hibernate.default_schema
use given schema name for unqualified tables (always optional)
hibernate.default_catalog
use given catalog name for unqualified tables (always optional)
hibernate.session_factory_name
If set, the factory attempts to bind this name to itself in the
JNDI context. This name is also used to support cross JVM
Session (de)serialization.
hibernate.transaction.manager_lookup_class
classname of org.hibernate.transaction.TransactionManagerLookup
implementor
hibernate.transaction.factory_class
the factory to use for instantiating Transactions.
(Defaults to JDBCTransactionFactory.)
final public static String STATEMENT_BATCH_SIZE(Code)
Maximum JDBC batch size. A nonzero value enables batch updates.
STATEMENT_FETCH_SIZE
final public static String STATEMENT_FETCH_SIZE(Code)
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database
when more rows are needed. If 0, JDBC driver default settings will be used.
TRANSACTION_MANAGER_STRATEGY
final public static String TRANSACTION_MANAGER_STRATEGY(Code)
TransactionManagerLookup implementor to use for obtaining the TransactionManager
TRANSACTION_STRATEGY
final public static String TRANSACTION_STRATEGY(Code)
TransactionFactory implementor to use for creating Transactions
final public static String USE_GET_GENERATED_KEYS(Code)
Tells the JDBC driver to attempt to retrieve row Id with the JDBC 3.0 PreparedStatement.getGeneratedKeys()
method. In general, performance will be better if this property is set to true and the underlying
JDBC driver supports getGeneratedKeys().
USE_IDENTIFIER_ROLLBACK
final public static String USE_IDENTIFIER_ROLLBACK(Code)
Return System properties, extended by any properties specified
in hibernate.properties.
Properties
isolationLevelToString
public static String isolationLevelToString(int isolation)(Code)
Get the name of a JDBC transaction isolation level
See Also:java.sql.Connection Parameters: isolation - as defined by java.sql.Connection a human-readable name
jvmHasJDK14Timestamp
public static boolean jvmHasJDK14Timestamp()(Code)
Does this JVM handle Timestamp in the JDK 1.4 compliant way?
Should we use streams to bind binary types to JDBC IN parameters.
Property hibernate.jdbc.use_streams_for_binary.
See Also:Environment.USE_STREAMS_FOR_BINARY