| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.cfg.Environment
public final class Environment
Provides access to configuration info passed in Properties objects.
 
 Hibernate has two property scopes:
 
| 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.) | 
| hibernate.query.substitutions | query language token substitutions | 
SessionFactory| Field Summary | |
|---|---|
| static String | AUTO_CLOSE_SESSIONEnable automatic session close at end of transaction | 
| static String | AUTOCOMMITJDBC autocommit mode | 
| static String | BATCH_STRATEGYSelect a custom batcher. | 
| static String | BATCH_VERSIONED_DATAShould versioned data be included in batching? | 
| static String | BYTECODE_PROVIDER | 
| static String | C3P0_ACQUIRE_INCREMENTNumber of connections acquired when pool is exhausted | 
| static String | C3P0_IDLE_TEST_PERIODIdle time before a C3P0 pooled connection is validated | 
| static String | C3P0_MAX_SIZEMaximum size of C3P0 connection pool | 
| static String | C3P0_MAX_STATEMENTSMaximum size of C3P0 statement cache | 
| static String | C3P0_MIN_SIZEMinimum size of C3P0 connection pool | 
| static String | C3P0_TIMEOUTMaximum idle time for C3P0 connection pool | 
| static String | CACHE_NAMESPACEThe CacheProvider JNDI namespace, if pre-bound to JNDI. | 
| static String | CACHE_PROVIDERThe CacheProvider implementation class | 
| static String | CACHE_PROVIDER_CONFIGThe CacheProvider implementation class | 
| static String | CACHE_REGION_FACTORYThe RegionFactoryimplementation class | 
| static String | CACHE_REGION_PREFIXThe CacheProvider region name prefix | 
| static String | CHECK_NULLABILITYEnable nullability checking. | 
| static String | CONNECTION_PREFIXprefix for arbitrary JDBC connection properties | 
| static String | CONNECTION_PROVIDERConnectionProvider implementor to use when obtaining connections | 
| static String | CURRENT_SESSION_CONTEXT_CLASSContext scoping impl for SessionFactory.getCurrentSession()processing. | 
| static String | DATASOURCEjava.sql.Datasource JNDI name | 
| static String | DEFAULT_BATCH_FETCH_SIZEThe default batch size for batch fetching | 
| static String | DEFAULT_CATALOGA default database catalog name to use for unqualified tablenames | 
| static String | DEFAULT_ENTITY_MODEThe EntityMode in which set the Session opened from the SessionFactory. | 
| static String | DEFAULT_SCHEMAA default database schema (owner) name to use for unqualified tablenames | 
| static String | DEFAULT_TRANSACTION_MANAGER_STRATEGYIf none is explicitly set, default TransactionManagerLookup implementor to use for obtaining the TransactionManager | 
| static String | DEFAULT_TRANSACTION_STRATEGYIf none is explicitly set, default TransactionFactory implementor to use for creating Transactions | 
| static String | DIALECTHibernate SQL Dialectclass | 
| static String | DIALECT_RESOLVERSDialectResolverclasses to register with theDialectFactory | 
| static String | DRIVERJDBC driver class | 
| static String | FLUSH_BEFORE_COMPLETIONEnable automatic flush during the JTA beforeCompletion() callback | 
| static String | FORMAT_SQLEnable formatting of SQL logged to the console | 
| static String | GENERATE_STATISTICSEnable statistics collection | 
| static String | GLOBALLY_QUOTED_IDENTIFIERSShould all database identifiers be quoted. | 
| static String | HBM2DDL_AUTOAuto export/update schema using hbm2ddl tool. | 
| static String | HBM2DDL_IMPORT_FILESComma-separated names of the optional files containing SQL DML statements executed during the SessionFactory creation. | 
| static String | ISOLATIONJDBC transaction isolation level | 
| static String | JACC_CONTEXTIDThe jacc context id of the deployment | 
| static String | JNDI_CLASSJNDI initial context class, Context.INITIAL_CONTEXT_FACTORY | 
| static String | JNDI_PREFIXprefix for arbitrary JNDI InitialContext properties | 
| static String | JNDI_URLJNDI provider URL, Context.PROVIDER_URL | 
| static String | JPAQL_STRICT_COMPLIANCE | 
| static String | MAX_FETCH_DEPTHMaximum depth of outer join fetching | 
| static String | ORDER_INSERTSEnable ordering of insert statements for the purpose of more efficient JDBC batching. | 
| static String | ORDER_UPDATESEnable ordering of update statements by primary key value | 
| static String | OUTPUT_STYLESHEETAn XSLT resource used to generate "custom" XML | 
| static String | PASSJDBC password | 
| static String | POOL_SIZEMaximum number of inactive connections for Hibernate's connection pool | 
| static String | PREFER_POOLED_VALUES_LOWhen using pooled optimizers, prefer interpreting the 
 database value as the lower (lo) boundary. | 
| static String | PROXOOL_EXISTING_POOLProxool property to configure the Proxool Provider from an already existing pool (true / false) | 
| static String | PROXOOL_POOL_ALIASProxool property with the Proxool pool alias to use (Required for PROXOOL_EXISTING_POOL, PROXOOL_PROPERTIES, or PROXOOL_XML) | 
| static String | PROXOOL_PREFIXProxool/Hibernate property prefix | 
| static String | PROXOOL_PROPERTIESProxool property to configure the Proxool Provider using a properties file (/path/to/proxool.properties) | 
| static String | PROXOOL_XMLProxool property to configure the Proxool Provider using an XML (/path/to/file.xml) | 
| static String | QUERY_CACHE_FACTORYThe QueryCacheFactory implementation class. | 
| static String | QUERY_PLAN_CACHE_MAX_SOFT_REFERENCESThe maximum number of soft references maintained by SoftLimitMRUCache. | 
| static String | QUERY_PLAN_CACHE_MAX_STRONG_REFERENCESThe maximum number of strong references maintained by SoftLimitMRUCache. | 
| static String | QUERY_STARTUP_CHECKINGShould named queries be checked during startup (the default is enabled). | 
| static String | QUERY_SUBSTITUTIONSA comma-separated list of token substitutions to use when translating a Hibernate query to SQL | 
| static String | QUERY_TRANSLATORThe classname of the HQL query parser factory | 
| static String | RELEASE_CONNECTIONSSpecifies how Hibernate should release JDBC connections. | 
| static String | SESSION_FACTORY_NAMEJNDI name to bind to SessionFactory | 
| static String | SHOW_SQLEnable logging of generated SQL to the console | 
| static String | SQL_EXCEPTION_CONVERTERThe SQLExceptionConverterto use for converting SQLExceptions
 to Hibernate's JDBCException hierarchy. | 
| static String | STATEMENT_BATCH_SIZEMaximum JDBC batch size. | 
| static String | STATEMENT_FETCH_SIZEGives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. | 
| static String | TRANSACTION_MANAGER_STRATEGYTransactionManagerLookup implementor to use for obtaining the TransactionManager | 
| static String | TRANSACTION_STRATEGYTransactionFactory implementor to use for creating Transactions | 
| static String | URLJDBC URL | 
| static String | USE_GET_GENERATED_KEYSTells the JDBC driver to attempt to retrieve row Id with the JDBC 3.0 PreparedStatement.getGeneratedKeys() method. | 
| static String | USE_IDENTIFIER_ROLLBACK | 
| static String | USE_MINIMAL_PUTSOptimize the cache for minimal puts instead of minimal gets | 
| static String | USE_QUERY_CACHEEnable the query cache (disabled by default) | 
| static String | USE_REFLECTION_OPTIMIZERUse bytecode libraries optimized property access | 
| static String | USE_SCROLLABLE_RESULTSETUse JDBC scrollable ResultSets. | 
| static String | USE_SECOND_LEVEL_CACHEEnable the second-level cache (enabled by default) | 
| static String | USE_SQL_COMMENTSAdd comments to the generated SQL | 
| static String | USE_STREAMS_FOR_BINARYUse java.io streams to read / write binary data from / to JDBC | 
| static String | USE_STRUCTURED_CACHEEnable use of structured second-level cache entries | 
| static String | USERJDBC user | 
| static String | USER_TRANSACTIONJNDI name of JTA UserTransaction object | 
| static String | WRAP_RESULT_SETSEnable wrapping of JDBC result sets in order to speed up column name lookups for broken JDBC drivers | 
| Method Summary | |
|---|---|
| static BytecodeProvider | buildBytecodeProvider(Properties properties) | 
| static BytecodeProvider | getBytecodeProvider() | 
| static Properties | getProperties()Return System properties, extended by any properties specified in hibernate.properties. | 
| static String | isolationLevelToString(int isolation)Get the name of a JDBC transaction isolation level | 
| static boolean | jvmHasJDK14Timestamp()Deprecated. Starting with 3.3 Hibernate requires JDK 1.4 or higher | 
| static boolean | jvmHasTimestampBug()Does this JVM's implementation of Timestamphave 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. | 
| static boolean | jvmSupportsGetGeneratedKeys()Deprecated. Starting with 3.3 Hibernate requires JDK 1.4 or higher | 
| static boolean | jvmSupportsLinkedHashCollections()Deprecated. Starting with 3.3 Hibernate requires JDK 1.4 or higher | 
| static boolean | useReflectionOptimizer()Should we use reflection optimization? | 
| static boolean | useStreamsForBinary()Should we use streams to bind binary types to JDBC IN parameters? | 
| static void | verifyProperties(Properties props)Issues warnings to the user when any obsolete or renamed property names are used. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String CONNECTION_PROVIDER
public static final String DRIVER
public static final String ISOLATION
public static final String URL
public static final String USER
public static final String PASS
public static final String AUTOCOMMIT
public static final String POOL_SIZE
public static final String DATASOURCE
public static final String CONNECTION_PREFIX
public static final String JNDI_CLASS
public static final String JNDI_URL
public static final String JNDI_PREFIX
public static final String SESSION_FACTORY_NAME
public static final String DIALECT
Dialect class
public static final String DIALECT_RESOLVERS
DialectResolver classes to register with the
 DialectFactory
public static final String DEFAULT_SCHEMA
public static final String DEFAULT_CATALOG
public static final String SHOW_SQL
public static final String FORMAT_SQL
public static final String USE_SQL_COMMENTS
public static final String MAX_FETCH_DEPTH
public static final String DEFAULT_BATCH_FETCH_SIZE
public static final String USE_STREAMS_FOR_BINARY
public static final String USE_SCROLLABLE_RESULTSET
public static final String USE_GET_GENERATED_KEYS
public static final String STATEMENT_FETCH_SIZE
public static final String STATEMENT_BATCH_SIZE
public static final String BATCH_STRATEGY
public static final String BATCH_VERSIONED_DATA
public static final String OUTPUT_STYLESHEET
public static final String C3P0_MAX_SIZE
public static final String C3P0_MIN_SIZE
public static final String C3P0_TIMEOUT
public static final String C3P0_MAX_STATEMENTS
public static final String C3P0_ACQUIRE_INCREMENT
public static final String C3P0_IDLE_TEST_PERIOD
public static final String PROXOOL_PREFIX
public static final String PROXOOL_XML
public static final String PROXOOL_PROPERTIES
public static final String PROXOOL_EXISTING_POOL
public static final String PROXOOL_POOL_ALIAS
public static final String AUTO_CLOSE_SESSION
public static final String FLUSH_BEFORE_COMPLETION
public static final String RELEASE_CONNECTIONS
public static final String CURRENT_SESSION_CONTEXT_CLASS
SessionFactory.getCurrentSession() processing.
public static final String TRANSACTION_STRATEGY
public static final String DEFAULT_TRANSACTION_STRATEGY
public static final String TRANSACTION_MANAGER_STRATEGY
public static final String DEFAULT_TRANSACTION_MANAGER_STRATEGY
public static final String USER_TRANSACTION
public static final String CACHE_PROVIDER
public static final String CACHE_REGION_FACTORY
RegionFactory implementation class
public static final String CACHE_PROVIDER_CONFIG
public static final String CACHE_NAMESPACE
public static final String USE_QUERY_CACHE
public static final String QUERY_CACHE_FACTORY
public static final String USE_SECOND_LEVEL_CACHE
public static final String USE_MINIMAL_PUTS
public static final String CACHE_REGION_PREFIX
public static final String USE_STRUCTURED_CACHE
public static final String GENERATE_STATISTICS
public static final String USE_IDENTIFIER_ROLLBACK
public static final String USE_REFLECTION_OPTIMIZER
public static final String QUERY_TRANSLATOR
public static final String QUERY_SUBSTITUTIONS
public static final String QUERY_STARTUP_CHECKING
public static final String HBM2DDL_AUTO
public static final String HBM2DDL_IMPORT_FILES
public static final String SQL_EXCEPTION_CONVERTER
SQLExceptionConverter to use for converting SQLExceptions
 to Hibernate's JDBCException hierarchy.  The default is to use the configured
 Dialect's preferred SQLExceptionConverter.
public static final String WRAP_RESULT_SETS
public static final String ORDER_UPDATES
public static final String ORDER_INSERTS
public static final String DEFAULT_ENTITY_MODE
public static final String JACC_CONTEXTID
public static final String GLOBALLY_QUOTED_IDENTIFIERS
public static final String CHECK_NULLABILITY
public static final String BYTECODE_PROVIDER
public static final String JPAQL_STRICT_COMPLIANCE
public static final String PREFER_POOLED_VALUES_LO
optimizers, prefer interpreting the 
 database value as the lower (lo) boundary.  The default is to interpret it as the high boundary.
public static final String QUERY_PLAN_CACHE_MAX_STRONG_REFERENCES
SoftLimitMRUCache. Default is 128.
public static final String QUERY_PLAN_CACHE_MAX_SOFT_REFERENCES
SoftLimitMRUCache. Default is 2048.
| Method Detail | 
|---|
public static void verifyProperties(Properties props)
props - The specified properties.public static BytecodeProvider getBytecodeProvider()
public static boolean jvmHasTimestampBug()
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.
Timestamp implementapublic static boolean jvmHasJDK14Timestamp()
Timestamp in the JDK 1.4 compliant way wrt to nano rolling>
Timestamp nano rolling is adhered to.public static boolean jvmSupportsLinkedHashCollections()
LinkedHashSet and LinkedHashMap?
 
 Note, this is true for JDK 1.4 and above; hence the deprecation.
LinkedHashSet and LinkedHashMap are available.LinkedHashSet, 
LinkedHashMappublic static boolean jvmSupportsGetGeneratedKeys()
Statement interface with a 'getGeneratedKeys' method?
 
 Note, this is true for JDK 1.4 and above; hence the deprecation.
Statementpublic static boolean useStreamsForBinary()
USE_STREAMS_FOR_BINARYpublic static boolean useReflectionOptimizer()
USE_REFLECTION_OPTIMIZER, 
getBytecodeProvider(), 
BytecodeProvider.getReflectionOptimizer(java.lang.Class, java.lang.String[], java.lang.String[], java.lang.Class[])public static Properties getProperties()
public static String isolationLevelToString(int isolation)
isolation - as defined by java.sql.Connection
Connectionpublic static BytecodeProvider buildBytecodeProvider(Properties properties)
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||