Top Description Fields Constructors Methods
org.hibernate.cfg

public final Class Environment

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.sql.Connection, .Statement, .Timestamp, java.util.HashMap, .Iterator, .Map, .Properties, org.slf4j.Logger, .LoggerFactory, org.hibernate.HibernateException, .Version, org.hibernate.bytecode.BytecodeProvider, org.hibernate.util.ConfigHelper, .PropertiesHelper

Provides access to configuration info passed in Properties objects.

Hibernate has two property scopes: The only system-level properties are 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()

propertymeaning
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.usernamedatabase username
hibernate.connection.passworddatabase 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.urlJNDI InitialContext URL
hibernate.jndi.classJNDI 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.)
hibernate.query.substitutionsquery language token substitutions
Author
Gavin King
See Also
org.hibernate.SessionFactory

Field Summary

Modifier and TypeField and Description
public static final String
AUTO_CLOSE_SESSION

Enable automatic session close at end of transaction

public static final String
AUTOCOMMIT

JDBC autocommit mode

public static final String
BATCH_STRATEGY

Select a custom batcher.

public static final String
BATCH_VERSIONED_DATA

Should versioned data be included in batching?

public static final String
private static final BytecodeProvider
public static final String
C3P0_ACQUIRE_INCREMENT

Number of connections acquired when pool is exhausted

public static final String
C3P0_IDLE_TEST_PERIOD

Idle time before a C3P0 pooled connection is validated

public static final String
C3P0_MAX_SIZE

Maximum size of C3P0 connection pool

public static final String
C3P0_MAX_STATEMENTS

Maximum size of C3P0 statement cache

public static final String
C3P0_MIN_SIZE

Minimum size of C3P0 connection pool

public static final String
C3P0_TIMEOUT

Maximum idle time for C3P0 connection pool

public static final String
CACHE_NAMESPACE

The CacheProvider JNDI namespace, if pre-bound to JNDI.

public static final String
CACHE_PROVIDER

The CacheProvider implementation class

public static final String
CACHE_PROVIDER_CONFIG

The CacheProvider implementation class

public static final String
public static final String
CACHE_REGION_PREFIX

The CacheProvider region name prefix

public static final String
CHECK_NULLABILITY

Enable nullability checking.

public static final String
CONNECTION_PREFIX

prefix for arbitrary JDBC connection properties

public static final String
CONNECTION_PROVIDER

ConnectionProvider implementor to use when obtaining connections

public static final String
public static final String
DATASOURCE

java.sql.Datasource JNDI name

public static final String
DEFAULT_BATCH_FETCH_SIZE

The default batch size for batch fetching

public static final String
DEFAULT_CATALOG

A default database catalog name to use for unqualified tablenames

public static final String
DEFAULT_ENTITY_MODE

The EntityMode in which set the Session opened from the SessionFactory.

public static final String
DEFAULT_SCHEMA

A default database schema (owner) name to use for unqualified tablenames

public static final String
DEFAULT_TRANSACTION_MANAGER_STRATEGY

If none is explicitly set, default TransactionManagerLookup implementor to use for obtaining the TransactionManager

public static final String
DEFAULT_TRANSACTION_STRATEGY

If none is explicitly set, default TransactionFactory implementor to use for creating Transactions

public static final String
public static final String
public static final String
DRIVER

JDBC driver class

private static final boolean
private static final boolean
public static final String
FLUSH_BEFORE_COMPLETION

Enable automatic flush during the JTA beforeCompletion() callback

public static final String
FORMAT_SQL

Enable formatting of SQL logged to the console

public static final String
GENERATE_STATISTICS

Enable statistics collection

private static final Properties
public static final String
GLOBALLY_QUOTED_IDENTIFIERS

Should all database identifiers be quoted.

public static final String
HBM2DDL_AUTO

Auto export/update schema using hbm2ddl tool.

public static final String
HBM2DDL_IMPORT_FILES

Comma-separated names of the optional files containing SQL DML statements executed during the SessionFactory creation.

public static final String
ISOLATION

JDBC transaction isolation level

private static final HashMap<K, V>
public static final String
JACC_CONTEXTID

The jacc context id of the deployment

public static final String
JNDI_CLASS

JNDI initial context class, Context.INITIAL_CONTEXT_FACTORY

public static final String
JNDI_PREFIX

prefix for arbitrary JNDI InitialContext properties

public static final String
JNDI_URL

JNDI provider URL, Context.PROVIDER_URL

public static final String
private static final boolean
private static final boolean
private static final boolean
private static final boolean
private static final Logger
public static final String
MAX_FETCH_DEPTH

Maximum depth of outer join fetching

private static final Map<K, V>
public static final String
ORDER_INSERTS

Enable ordering of insert statements for the purpose of more efficient JDBC batching.

public static final String
ORDER_UPDATES

Enable ordering of update statements by primary key value

public static final String
OUTPUT_STYLESHEET

An XSLT resource used to generate "custom" XML

public static final String
PASS

JDBC password

public static final String
POOL_SIZE

Maximum number of inactive connections for Hibernate's connection pool

public static final String
PREFER_POOLED_VALUES_LO

When using pooled optimizers, prefer interpreting the database value as the lower (lo) boundary.

public static final String
PROXOOL_EXISTING_POOL

Proxool property to configure the Proxool Provider from an already existing pool (true / false)

public static final String
PROXOOL_POOL_ALIAS

Proxool property with the Proxool pool alias to use (Required for PROXOOL_EXISTING_POOL, PROXOOL_PROPERTIES, or PROXOOL_XML)

public static final String
PROXOOL_PREFIX

Proxool/Hibernate property prefix

public static final String
PROXOOL_PROPERTIES

Proxool property to configure the Proxool Provider using a properties file (/path/to/proxool.properties)

public static final String
PROXOOL_XML

Proxool property to configure the Proxool Provider using an XML (/path/to/file.xml)

public static final String
QUERY_CACHE_FACTORY

The QueryCacheFactory implementation class.

public static final String
QUERY_PLAN_CACHE_MAX_SOFT_REFERENCES

The maximum number of soft references maintained by org.hibernate.util.SoftLimitMRUCache.

public static final String
QUERY_PLAN_CACHE_MAX_STRONG_REFERENCES

The maximum number of strong references maintained by org.hibernate.util.SoftLimitMRUCache.

public static final String
QUERY_STARTUP_CHECKING

Should named queries be checked during startup (the default is enabled).

public static final String
QUERY_SUBSTITUTIONS

A comma-separated list of token substitutions to use when translating a Hibernate query to SQL

public static final String
QUERY_TRANSLATOR

The classname of the HQL query parser factory

public static final String
RELEASE_CONNECTIONS

Specifies how Hibernate should release JDBC connections.

private static final Map<K, V>
public static final String
SESSION_FACTORY_NAME

JNDI name to bind to SessionFactory

public static final String
SHOW_SQL

Enable logging of generated SQL to the console

public static final String
SQL_EXCEPTION_CONVERTER

The org.hibernate.exception.SQLExceptionConverter to use for converting SQLExceptions to Hibernate's JDBCException hierarchy.

public static final String
STATEMENT_BATCH_SIZE

Maximum JDBC batch size.

public static final String
STATEMENT_FETCH_SIZE

Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.

public static final String
TRANSACTION_MANAGER_STRATEGY

TransactionManagerLookup implementor to use for obtaining the TransactionManager

public static final String
TRANSACTION_STRATEGY

TransactionFactory implementor to use for creating Transactions

public static final String
URL

JDBC URL

public static final String
USE_GET_GENERATED_KEYS

Tells the JDBC driver to attempt to retrieve row Id with the JDBC 3.0 PreparedStatement.getGeneratedKeys() method.

public static final String
public static final String
USE_MINIMAL_PUTS

Optimize the cache for minimal puts instead of minimal gets

public static final String
USE_QUERY_CACHE

Enable the query cache (disabled by default)

public static final String
USE_REFLECTION_OPTIMIZER

Use bytecode libraries optimized property access

public static final String
USE_SCROLLABLE_RESULTSET

Use JDBC scrollable ResultSets.

public static final String
USE_SECOND_LEVEL_CACHE

Enable the second-level cache (enabled by default)

public static final String
USE_SQL_COMMENTS

Add comments to the generated SQL

public static final String
USE_STREAMS_FOR_BINARY

Use java.io streams to read / write binary data from / to JDBC

public static final String
USE_STRUCTURED_CACHE

Enable use of structured second-level cache entries

public static final String
USER

JDBC user

public static final String
USER_TRANSACTION

JNDI name of JTA UserTransaction object

public static final String
WRAP_RESULT_SETS

Enable wrapping of JDBC result sets in order to speed up column name lookups for broken JDBC drivers

Constructor Summary

AccessConstructor and Description
private
Environment()

Disallow instantiation

Method Summary

Modifier and TypeMethod and Description
public static BytecodeProvider
private static BytecodeProvider
public static BytecodeProvider
public static Properties

Returns:

Properties
getProperties
()

Return System properties, extended by any properties specified in hibernate.properties.

public static String

Returns:

a human-readable name
isolationLevelToString
(int
as defined by java.sql.Connection
isolation
)

Get the name of a JDBC transaction isolation level

public static boolean

Returns:

True if the JDK 1.4 (JDBC3) specification for java.sql.Timestamp nano rolling is adhered to.
jvmHasJDK14Timestamp
()

Deprecated Starting with 3.3 Hibernate requires JDK 1.4 or higher
Does this JVM handle java.sql.Timestamp in the JDK 1.4 compliant way wrt to nano rolling>
public static boolean

Returns:

True if the JVM's Timestamp implementa
jvmHasTimestampBug
()

Does this JVM's implementation of java.sql.Timestamp have a bug in which the following is true: new java.sql.Timestamp( x ).getTime() != x

NOTE : IBM JDK 1.3.1 the only known JVM to exhibit this behavior.

public static boolean

Returns:

True if generated keys can be retrieved via Statement; false otherwise.
jvmSupportsGetGeneratedKeys
()

Deprecated Starting with 3.3 Hibernate requires JDK 1.4 or higher
Does this JDK/JVM define the JDBC Statement interface with a 'getGeneratedKeys' method?
public static boolean

Returns:

True if java.util.LinkedHashSet and java.util.LinkedHashMap are available.
jvmSupportsLinkedHashCollections
()

Deprecated Starting with 3.3 Hibernate requires JDK 1.4 or higher
Does this JVM support java.util.LinkedHashSet and java.util.LinkedHashMap?
public static boolean

Returns:

True if reflection optimization should be used; false otherwise.
useReflectionOptimizer
()

Should we use reflection optimization?

public static boolean

Returns:

True if streams should be used for binary data handling; false otherwise.
useStreamsForBinary
()

Should we use streams to bind binary types to JDBC IN parameters?

public static void
verifyProperties(Properties
The specified properties.
props
)

Issues warnings to the user when any obsolete or renamed property names are used.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AUTO_CLOSE_SESSIONback to summary
public static final String AUTO_CLOSE_SESSION

Enable automatic session close at end of transaction

AUTOCOMMITback to summary
public static final String AUTOCOMMIT

JDBC autocommit mode

BATCH_STRATEGYback to summary
public static final String BATCH_STRATEGY

Select a custom batcher.

BATCH_VERSIONED_DATAback to summary
public static final String BATCH_VERSIONED_DATA

Should versioned data be included in batching?

BYTECODE_PROVIDERback to summary
public static final String BYTECODE_PROVIDER
BYTECODE_PROVIDER_INSTANCEback to summary
private static final BytecodeProvider BYTECODE_PROVIDER_INSTANCE
C3P0_ACQUIRE_INCREMENTback to summary
public static final String C3P0_ACQUIRE_INCREMENT

Number of connections acquired when pool is exhausted

C3P0_IDLE_TEST_PERIODback to summary
public static final String C3P0_IDLE_TEST_PERIOD

Idle time before a C3P0 pooled connection is validated

C3P0_MAX_SIZEback to summary
public static final String C3P0_MAX_SIZE

Maximum size of C3P0 connection pool

C3P0_MAX_STATEMENTSback to summary
public static final String C3P0_MAX_STATEMENTS

Maximum size of C3P0 statement cache

C3P0_MIN_SIZEback to summary
public static final String C3P0_MIN_SIZE

Minimum size of C3P0 connection pool

C3P0_TIMEOUTback to summary
public static final String C3P0_TIMEOUT

Maximum idle time for C3P0 connection pool

CACHE_NAMESPACEback to summary
public static final String CACHE_NAMESPACE

The CacheProvider JNDI namespace, if pre-bound to JNDI.

CACHE_PROVIDERback to summary
public static final String CACHE_PROVIDER

The CacheProvider implementation class

CACHE_PROVIDER_CONFIGback to summary
public static final String CACHE_PROVIDER_CONFIG

The CacheProvider implementation class

CACHE_REGION_FACTORYback to summary
public static final String CACHE_REGION_FACTORY

The org.hibernate.cache.RegionFactory implementation class

CACHE_REGION_PREFIXback to summary
public static final String CACHE_REGION_PREFIX

The CacheProvider region name prefix

CHECK_NULLABILITYback to summary
public static final String CHECK_NULLABILITY

Enable nullability checking. Raises an exception if a property marked as not-null is null. Default to false if Bean Validation is present in the classpath and Hibernate Annotations is used, true otherwise.

CONNECTION_PREFIXback to summary
public static final String CONNECTION_PREFIX

prefix for arbitrary JDBC connection properties

CONNECTION_PROVIDERback to summary
public static final String CONNECTION_PROVIDER

ConnectionProvider implementor to use when obtaining connections

CURRENT_SESSION_CONTEXT_CLASSback to summary
public static final String CURRENT_SESSION_CONTEXT_CLASS

Context scoping impl for org.hibernate.SessionFactory#getCurrentSession() processing.

DATASOURCEback to summary
public static final String DATASOURCE

java.sql.Datasource JNDI name

DEFAULT_BATCH_FETCH_SIZEback to summary
public static final String DEFAULT_BATCH_FETCH_SIZE

The default batch size for batch fetching

DEFAULT_CATALOGback to summary
public static final String DEFAULT_CATALOG

A default database catalog name to use for unqualified tablenames

DEFAULT_ENTITY_MODEback to summary
public static final String DEFAULT_ENTITY_MODE

The EntityMode in which set the Session opened from the SessionFactory.

DEFAULT_SCHEMAback to summary
public static final String DEFAULT_SCHEMA

A default database schema (owner) name to use for unqualified tablenames

DEFAULT_TRANSACTION_MANAGER_STRATEGYback to summary
public static final String DEFAULT_TRANSACTION_MANAGER_STRATEGY

If none is explicitly set, default TransactionManagerLookup implementor to use for obtaining the TransactionManager

DEFAULT_TRANSACTION_STRATEGYback to summary
public static final String DEFAULT_TRANSACTION_STRATEGY

If none is explicitly set, default TransactionFactory implementor to use for creating Transactions

DIALECTback to summary
public static final String DIALECT

Hibernate SQL org.hibernate.dialect.Dialect class

DIALECT_RESOLVERSback to summary
public static final String DIALECT_RESOLVERS

org.hibernate.dialect.resolver.DialectResolver classes to register with the org.hibernate.dialect.resolver.DialectFactory

DRIVERback to summary
public static final String DRIVER

JDBC driver class

ENABLE_BINARY_STREAMSback to summary
private static final boolean ENABLE_BINARY_STREAMS
ENABLE_REFLECTION_OPTIMIZERback to summary
private static final boolean ENABLE_REFLECTION_OPTIMIZER
FLUSH_BEFORE_COMPLETIONback to summary
public static final String FLUSH_BEFORE_COMPLETION

Enable automatic flush during the JTA beforeCompletion() callback

FORMAT_SQLback to summary
public static final String FORMAT_SQL

Enable formatting of SQL logged to the console

GENERATE_STATISTICSback to summary
public static final String GENERATE_STATISTICS

Enable statistics collection

GLOBAL_PROPERTIESback to summary
private static final Properties GLOBAL_PROPERTIES
GLOBALLY_QUOTED_IDENTIFIERSback to summary
public static final String GLOBALLY_QUOTED_IDENTIFIERS

Should all database identifiers be quoted.

HBM2DDL_AUTOback to summary
public static final String HBM2DDL_AUTO

Auto export/update schema using hbm2ddl tool. Valid values are update, create, create-drop and validate.

HBM2DDL_IMPORT_FILESback to summary
public static final String HBM2DDL_IMPORT_FILES

Comma-separated names of the optional files containing SQL DML statements executed during the SessionFactory creation. File order matters, the statements of a give file are executed before the statements of the following files. These statements are only executed if the schema is created ie if hibernate.hbm2ddl.auto is set to create or create-drop. The default value is /import.sql

ISOLATIONback to summary
public static final String ISOLATION

JDBC transaction isolation level

ISOLATION_LEVELSback to summary
private static final HashMap<K, V> ISOLATION_LEVELS
JACC_CONTEXTIDback to summary
public static final String JACC_CONTEXTID

The jacc context id of the deployment

JNDI_CLASSback to summary
public static final String JNDI_CLASS

JNDI initial context class, Context.INITIAL_CONTEXT_FACTORY

JNDI_PREFIXback to summary
public static final String JNDI_PREFIX

prefix for arbitrary JNDI InitialContext properties

JNDI_URLback to summary
public static final String JNDI_URL

JNDI provider URL, Context.PROVIDER_URL

JPAQL_STRICT_COMPLIANCEback to summary
public static final String JPAQL_STRICT_COMPLIANCE
JVM_HAS_JDK14_TIMESTAMPback to summary
private static final boolean JVM_HAS_JDK14_TIMESTAMP
JVM_HAS_TIMESTAMP_BUGback to summary
private static final boolean JVM_HAS_TIMESTAMP_BUG
JVM_SUPPORTS_GET_GENERATED_KEYSback to summary
private static final boolean JVM_SUPPORTS_GET_GENERATED_KEYS
JVM_SUPPORTS_LINKED_HASH_COLLECTIONSback to summary
private static final boolean JVM_SUPPORTS_LINKED_HASH_COLLECTIONS
logback to summary
private static final Logger log
MAX_FETCH_DEPTHback to summary
public static final String MAX_FETCH_DEPTH

Maximum depth of outer join fetching

OBSOLETE_PROPERTIESback to summary
private static final Map<K, V> OBSOLETE_PROPERTIES
ORDER_INSERTSback to summary
public static final String ORDER_INSERTS

Enable ordering of insert statements for the purpose of more efficient JDBC batching.

ORDER_UPDATESback to summary
public static final String ORDER_UPDATES

Enable ordering of update statements by primary key value

OUTPUT_STYLESHEETback to summary
public static final String OUTPUT_STYLESHEET

An XSLT resource used to generate "custom" XML

PASSback to summary
public static final String PASS

JDBC password

POOL_SIZEback to summary
public static final String POOL_SIZE

Maximum number of inactive connections for Hibernate's connection pool

PREFER_POOLED_VALUES_LOback to summary
public static final String PREFER_POOLED_VALUES_LO

When using pooled optimizers, prefer interpreting the database value as the lower (lo) boundary. The default is to interpret it as the high boundary.

PROXOOL_EXISTING_POOLback to summary
public static final String PROXOOL_EXISTING_POOL

Proxool property to configure the Proxool Provider from an already existing pool (true / false)

PROXOOL_POOL_ALIASback to summary
public static final String PROXOOL_POOL_ALIAS

Proxool property with the Proxool pool alias to use (Required for PROXOOL_EXISTING_POOL, PROXOOL_PROPERTIES, or PROXOOL_XML)

PROXOOL_PREFIXback to summary
public static final String PROXOOL_PREFIX

Proxool/Hibernate property prefix

PROXOOL_PROPERTIESback to summary
public static final String PROXOOL_PROPERTIES

Proxool property to configure the Proxool Provider using a properties file (/path/to/proxool.properties)

PROXOOL_XMLback to summary
public static final String PROXOOL_XML

Proxool property to configure the Proxool Provider using an XML (/path/to/file.xml)

QUERY_CACHE_FACTORYback to summary
public static final String QUERY_CACHE_FACTORY

The QueryCacheFactory implementation class.

QUERY_PLAN_CACHE_MAX_SOFT_REFERENCESback to summary
public static final String QUERY_PLAN_CACHE_MAX_SOFT_REFERENCES

The maximum number of soft references maintained by org.hibernate.util.SoftLimitMRUCache. Default is 2048.

QUERY_PLAN_CACHE_MAX_STRONG_REFERENCESback to summary
public static final String QUERY_PLAN_CACHE_MAX_STRONG_REFERENCES

The maximum number of strong references maintained by org.hibernate.util.SoftLimitMRUCache. Default is 128.

QUERY_STARTUP_CHECKINGback to summary
public static final String QUERY_STARTUP_CHECKING

Should named queries be checked during startup (the default is enabled).

Mainly intended for test environments.

QUERY_SUBSTITUTIONSback to summary
public static final String QUERY_SUBSTITUTIONS

A comma-separated list of token substitutions to use when translating a Hibernate query to SQL

QUERY_TRANSLATORback to summary
public static final String QUERY_TRANSLATOR

The classname of the HQL query parser factory

RELEASE_CONNECTIONSback to summary
public static final String RELEASE_CONNECTIONS

Specifies how Hibernate should release JDBC connections.

RENAMED_PROPERTIESback to summary
private static final Map<K, V> RENAMED_PROPERTIES
SESSION_FACTORY_NAMEback to summary
public static final String SESSION_FACTORY_NAME

JNDI name to bind to SessionFactory

SHOW_SQLback to summary
public static final String SHOW_SQL

Enable logging of generated SQL to the console

SQL_EXCEPTION_CONVERTERback to summary
public static final String SQL_EXCEPTION_CONVERTER

The org.hibernate.exception.SQLExceptionConverter to use for converting SQLExceptions to Hibernate's JDBCException hierarchy. The default is to use the configured org.hibernate.dialect.Dialect's preferred SQLExceptionConverter.

STATEMENT_BATCH_SIZEback to summary
public static final String STATEMENT_BATCH_SIZE

Maximum JDBC batch size. A nonzero value enables batch updates.

STATEMENT_FETCH_SIZEback to summary
public static final String STATEMENT_FETCH_SIZE

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_STRATEGYback to summary
public static final String TRANSACTION_MANAGER_STRATEGY

TransactionManagerLookup implementor to use for obtaining the TransactionManager

TRANSACTION_STRATEGYback to summary
public static final String TRANSACTION_STRATEGY

TransactionFactory implementor to use for creating Transactions

URLback to summary
public static final String URL

JDBC URL

USE_GET_GENERATED_KEYSback to summary
public static final String USE_GET_GENERATED_KEYS

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_ROLLBACKback to summary
public static final String USE_IDENTIFIER_ROLLBACK
USE_MINIMAL_PUTSback to summary
public static final String USE_MINIMAL_PUTS

Optimize the cache for minimal puts instead of minimal gets

USE_QUERY_CACHEback to summary
public static final String USE_QUERY_CACHE

Enable the query cache (disabled by default)

USE_REFLECTION_OPTIMIZERback to summary
public static final String USE_REFLECTION_OPTIMIZER

Use bytecode libraries optimized property access

USE_SCROLLABLE_RESULTSETback to summary
public static final String USE_SCROLLABLE_RESULTSET

Use JDBC scrollable ResultSets. This property is only necessary when there is no ConnectionProvider, ie. the user is supplying JDBC connections.

USE_SECOND_LEVEL_CACHEback to summary
public static final String USE_SECOND_LEVEL_CACHE

Enable the second-level cache (enabled by default)

USE_SQL_COMMENTSback to summary
public static final String USE_SQL_COMMENTS

Add comments to the generated SQL

USE_STREAMS_FOR_BINARYback to summary
public static final String USE_STREAMS_FOR_BINARY

Use java.io streams to read / write binary data from / to JDBC

USE_STRUCTURED_CACHEback to summary
public static final String USE_STRUCTURED_CACHE

Enable use of structured second-level cache entries

USERback to summary
public static final String USER

JDBC user

USER_TRANSACTIONback to summary
public static final String USER_TRANSACTION

JNDI name of JTA UserTransaction object

WRAP_RESULT_SETSback to summary
public static final String WRAP_RESULT_SETS

Enable wrapping of JDBC result sets in order to speed up column name lookups for broken JDBC drivers

Constructor Detail

Environmentback to summary
private Environment()

Disallow instantiation

Method Detail

buildBytecodeProviderback to summary
public static BytecodeProvider buildBytecodeProvider(Properties properties)
buildBytecodeProviderback to summary
private static BytecodeProvider buildBytecodeProvider(String providerName)
getBytecodeProviderback to summary
public static BytecodeProvider getBytecodeProvider()
getPropertiesback to summary
public static Properties getProperties()

Return System properties, extended by any properties specified in hibernate.properties.

Returns:Properties

Properties

isolationLevelToStringback to summary
public static String isolationLevelToString(int isolation)

Get the name of a JDBC transaction isolation level

Parameters
isolation:int

as defined by java.sql.Connection

Returns:String

a human-readable name

See Also
java.sql.Connection
jvmHasJDK14Timestampback to summary
public static boolean jvmHasJDK14Timestamp()

Deprecated

Starting with 3.3 Hibernate requires JDK 1.4 or higher

Does this JVM handle java.sql.Timestamp in the JDK 1.4 compliant way wrt to nano rolling>

Returns:boolean

True if the JDK 1.4 (JDBC3) specification for java.sql.Timestamp nano rolling is adhered to.

jvmHasTimestampBugback to summary
public static boolean jvmHasTimestampBug()

Does this JVM's implementation of java.sql.Timestamp have a bug in which the following is true: new java.sql.Timestamp( x ).getTime() != x

NOTE : IBM JDK 1.3.1 the only known JVM to exhibit this behavior.

Returns:boolean

True if the JVM's Timestamp implementa

jvmSupportsGetGeneratedKeysback to summary
public static boolean jvmSupportsGetGeneratedKeys()

Deprecated

Starting with 3.3 Hibernate requires JDK 1.4 or higher

Does this JDK/JVM define the JDBC Statement interface with a 'getGeneratedKeys' method?

Note, this is true for JDK 1.4 and above; hence the deprecation.

Returns:boolean

True if generated keys can be retrieved via Statement; false otherwise.

See Also
Statement
jvmSupportsLinkedHashCollectionsback to summary
public static boolean jvmSupportsLinkedHashCollections()

Deprecated

Starting with 3.3 Hibernate requires JDK 1.4 or higher

Does this JVM support java.util.LinkedHashSet and java.util.LinkedHashMap?

Note, this is true for JDK 1.4 and above; hence the deprecation.

Returns:boolean

True if java.util.LinkedHashSet and java.util.LinkedHashMap are available.

See Also
java.util.LinkedHashSet, java.util.LinkedHashMap
useReflectionOptimizerback to summary
public static boolean useReflectionOptimizer()

Should we use reflection optimization?

Returns:boolean

True if reflection optimization should be used; false otherwise.

See Also
USE_REFLECTION_OPTIMIZER, getBytecodeProvider(), BytecodeProvider#getReflectionOptimizer
useStreamsForBinaryback to summary
public static boolean useStreamsForBinary()

Should we use streams to bind binary types to JDBC IN parameters?

Returns:boolean

True if streams should be used for binary data handling; false otherwise.

See Also
USE_STREAMS_FOR_BINARY
verifyPropertiesback to summary
public static void verifyProperties(Properties props)

Issues warnings to the user when any obsolete or renamed property names are used.

Parameters
props:Properties

The specified properties.