Java Doc for Environment.java in  » Database-ORM » hibernate » org » hibernate » cfg » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » hibernate » org.hibernate.cfg 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hibernate.cfg.Environment

Environment
final public class Environment (Code)
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()

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

See Also:   org.hibernate.SessionFactory
author:
   Gavin King


Field Summary
final public static  StringAUTOCOMMIT
    
final public static  StringAUTO_CLOSE_SESSION
    
final public static  StringBATCH_STRATEGY
     Select a custom batcher.
final public static  StringBATCH_VERSIONED_DATA
    
final public static  StringBYTECODE_PROVIDER
    
final public static  StringC3P0_ACQUIRE_INCREMENT
    
final public static  StringC3P0_IDLE_TEST_PERIOD
    
final public static  StringC3P0_MAX_SIZE
    
final public static  StringC3P0_MAX_STATEMENTS
    
final public static  StringC3P0_MIN_SIZE
    
final public static  StringC3P0_TIMEOUT
    
final public static  StringCACHE_NAMESPACE
     The CacheProvider JNDI namespace, if pre-bound to JNDI.
final public static  StringCACHE_PROVIDER
    
final public static  StringCACHE_PROVIDER_CONFIG
    
final public static  StringCACHE_REGION_PREFIX
    
final public static  StringCONNECTION_PREFIX
    
final public static  StringCONNECTION_PROVIDER
    
final public static  StringCURRENT_SESSION_CONTEXT_CLASS
     Context scoping impl for org.hibernate.SessionFactory.getCurrentSession processing.
final public static  StringDATASOURCE
    
final public static  StringDEFAULT_BATCH_FETCH_SIZE
    
final public static  StringDEFAULT_CATALOG
    
final public static  StringDEFAULT_ENTITY_MODE
     The EntityMode in which set the Session opened from the SessionFactory.
final public static  StringDEFAULT_SCHEMA
    
final public static  StringDIALECT
    
final public static  StringDRIVER
    
final public static  StringFLUSH_BEFORE_COMPLETION
    
final public static  StringFORMAT_SQL
    
final public static  StringGENERATE_STATISTICS
    
final public static  StringHBM2DDL_AUTO
     Auto export/update schema using hbm2ddl tool.
final public static  StringISOLATION
    
final public static  StringJACC_CONTEXTID
    
final public static  StringJNDI_CLASS
    
final public static  StringJNDI_PREFIX
    
final public static  StringJNDI_URL
    
final public static  StringJPAQL_STRICT_COMPLIANCE
    
final public static  StringMAX_FETCH_DEPTH
    
final public static  StringORDER_INSERTS
     Enable ordering of insert statements for the purpose of more effecient JDBC batching.
final public static  StringORDER_UPDATES
    
final public static  StringOUTPUT_STYLESHEET
    
final public static  StringPASS
    
final public static  StringPOOL_SIZE
    
final public static  StringPROXOOL_EXISTING_POOL
    
final public static  StringPROXOOL_POOL_ALIAS
    
final public static  StringPROXOOL_PREFIX
    
final public static  StringPROXOOL_PROPERTIES
    
final public static  StringPROXOOL_XML
    
final public static  StringQUERY_CACHE_FACTORY
     The QueryCacheFactory implementation class.
final public static  StringQUERY_STARTUP_CHECKING
     Should named queries be checked during startup (the default is enabled).
final public static  StringQUERY_SUBSTITUTIONS
    
final public static  StringQUERY_TRANSLATOR
    
final public static  StringRELEASE_CONNECTIONS
     Specifies how Hibernate should release JDBC connections.
final public static  StringSESSION_FACTORY_NAME
    
final public static  StringSHOW_SQL
    
final public static  StringSQL_EXCEPTION_CONVERTER
     The org.hibernate.exception.SQLExceptionConverter to use for converting SQLExceptions to Hibernate's JDBCException hierarchy.
final public static  StringSTATEMENT_BATCH_SIZE
     Maximum JDBC batch size.
final public static  StringSTATEMENT_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.
final public static  StringTRANSACTION_MANAGER_STRATEGY
    
final public static  StringTRANSACTION_STRATEGY
    
final public static  StringURL
    
final public static  StringUSER
    
final public static  StringUSER_TRANSACTION
    
final public static  StringUSE_GET_GENERATED_KEYS
     Tells the JDBC driver to attempt to retrieve row Id with the JDBC 3.0 PreparedStatement.getGeneratedKeys() method.
final public static  StringUSE_IDENTIFIER_ROLLBACK
    
final public static  StringUSE_MINIMAL_PUTS
    
final public static  StringUSE_QUERY_CACHE
    
final public static  StringUSE_REFLECTION_OPTIMIZER
    
final public static  StringUSE_SCROLLABLE_RESULTSET
     Use JDBC scrollable ResultSets.
final public static  StringUSE_SECOND_LEVEL_CACHE
    
final public static  StringUSE_SQL_COMMENTS
    
final public static  StringUSE_STREAMS_FOR_BINARY
    
final public static  StringUSE_STRUCTURED_CACHE
    
final public static  StringVERSION
    
final public static  StringWRAP_RESULT_SETS
    


Method Summary
public static  BytecodeProviderbuildBytecodeProvider(Properties properties)
    
public static  BytecodeProvidergetBytecodeProvider()
    
public static  PropertiesgetProperties()
     Return System properties, extended by any properties specified in hibernate.properties.
public static  StringisolationLevelToString(int isolation)
    
public static  booleanjvmHasJDK14Timestamp()
    
public static  booleanjvmHasTimestampBug()
     Does this JVM have the IBM JDK 1.3.1.
public static  booleanjvmSupportsGetGeneratedKeys()
    
public static  booleanjvmSupportsLinkedHashCollections()
     Does this JVM support LinkedHashSet, LinkedHashMap.
public static  booleanuseReflectionOptimizer()
     Should we use CGLIB reflection optimizer.
public static  booleanuseStreamsForBinary()
     Should we use streams to bind binary types to JDBC IN parameters.
public static  voidverifyProperties(Properties props)
     Issues warnings to the user when any obsolete property names are used.

Field Detail
AUTOCOMMIT
final public static String AUTOCOMMIT(Code)
JDBC autocommit mode



AUTO_CLOSE_SESSION
final public static String AUTO_CLOSE_SESSION(Code)
Enable automatic session close at end of transaction



BATCH_STRATEGY
final public static String BATCH_STRATEGY(Code)
Select a custom batcher.



BATCH_VERSIONED_DATA
final public static String BATCH_VERSIONED_DATA(Code)
Should versioned data be included in batching?



BYTECODE_PROVIDER
final public static String BYTECODE_PROVIDER(Code)



C3P0_ACQUIRE_INCREMENT
final public static String C3P0_ACQUIRE_INCREMENT(Code)
Number of connections acquired when pool is exhausted



C3P0_IDLE_TEST_PERIOD
final public static String C3P0_IDLE_TEST_PERIOD(Code)
Idle time before a C3P0 pooled connection is validated



C3P0_MAX_SIZE
final public static String C3P0_MAX_SIZE(Code)
Maximum size of C3P0 connection pool



C3P0_MAX_STATEMENTS
final public static String C3P0_MAX_STATEMENTS(Code)
Maximum size of C3P0 statement cache



C3P0_MIN_SIZE
final public static String C3P0_MIN_SIZE(Code)
Minimum size of C3P0 connection pool



C3P0_TIMEOUT
final public static String C3P0_TIMEOUT(Code)
Maximum idle time for C3P0 connection pool



CACHE_NAMESPACE
final public static String CACHE_NAMESPACE(Code)
The CacheProvider JNDI namespace, if pre-bound to JNDI.



CACHE_PROVIDER
final public static String CACHE_PROVIDER(Code)
The CacheProvider implementation class



CACHE_PROVIDER_CONFIG
final public static String CACHE_PROVIDER_CONFIG(Code)
The CacheProvider implementation class



CACHE_REGION_PREFIX
final public static String CACHE_REGION_PREFIX(Code)
The CacheProvider region name prefix



CONNECTION_PREFIX
final public static String CONNECTION_PREFIX(Code)
prefix for arbitrary JDBC connection properties



CONNECTION_PROVIDER
final public static String CONNECTION_PROVIDER(Code)
ConnectionProvider implementor to use when obtaining connections



CURRENT_SESSION_CONTEXT_CLASS
final public static String CURRENT_SESSION_CONTEXT_CLASS(Code)
Context scoping impl for org.hibernate.SessionFactory.getCurrentSession processing.



DATASOURCE
final public static String DATASOURCE(Code)
java.sql.Datasource JNDI name



DEFAULT_BATCH_FETCH_SIZE
final public static String DEFAULT_BATCH_FETCH_SIZE(Code)
The default batch size for batch fetching



DEFAULT_CATALOG
final public static String DEFAULT_CATALOG(Code)
A default database catalog name to use for unqualified tablenames



DEFAULT_ENTITY_MODE
final public static String DEFAULT_ENTITY_MODE(Code)
The EntityMode in which set the Session opened from the SessionFactory.



DEFAULT_SCHEMA
final public static String DEFAULT_SCHEMA(Code)
A default database schema (owner) name to use for unqualified tablenames



DIALECT
final public static String DIALECT(Code)
Hibernate SQL Dialect class



DRIVER
final public static String DRIVER(Code)
JDBC driver class



FLUSH_BEFORE_COMPLETION
final public static String FLUSH_BEFORE_COMPLETION(Code)
Enable automatic flush during the JTA beforeCompletion() callback



FORMAT_SQL
final public static String FORMAT_SQL(Code)
Enable formatting of SQL logged to the console



GENERATE_STATISTICS
final public static String GENERATE_STATISTICS(Code)
Enable statistics collection



HBM2DDL_AUTO
final public static String HBM2DDL_AUTO(Code)
Auto export/update schema using hbm2ddl tool. Valid values are update, create, create-drop and validate.



ISOLATION
final public static String ISOLATION(Code)
JDBC transaction isolation level



JACC_CONTEXTID
final public static String JACC_CONTEXTID(Code)
The jacc context id of the deployment



JNDI_CLASS
final public static String JNDI_CLASS(Code)
JNDI initial context class, Context.INITIAL_CONTEXT_FACTORY



JNDI_PREFIX
final public static String JNDI_PREFIX(Code)
prefix for arbitrary JNDI InitialContext properties



JNDI_URL
final public static String JNDI_URL(Code)
JNDI provider URL, Context.PROVIDER_URL



JPAQL_STRICT_COMPLIANCE
final public static String JPAQL_STRICT_COMPLIANCE(Code)



MAX_FETCH_DEPTH
final public static String MAX_FETCH_DEPTH(Code)
Maximum depth of outer join fetching



ORDER_INSERTS
final public static String ORDER_INSERTS(Code)
Enable ordering of insert statements for the purpose of more effecient JDBC batching.



ORDER_UPDATES
final public static String ORDER_UPDATES(Code)
Enable ordering of update statements by primary key value



OUTPUT_STYLESHEET
final public static String OUTPUT_STYLESHEET(Code)
An XSLT resource used to generate "custom" XML



PASS
final public static String PASS(Code)
JDBC password



POOL_SIZE
final public static String POOL_SIZE(Code)
Maximum number of inactive connections for Hibernate's connection pool



PROXOOL_EXISTING_POOL
final public static String PROXOOL_EXISTING_POOL(Code)
Proxool property to configure the Proxool Provider from an already existing pool (true / false)



PROXOOL_POOL_ALIAS
final public static String PROXOOL_POOL_ALIAS(Code)
Proxool property with the Proxool pool alias to use (Required for PROXOOL_EXISTING_POOL, PROXOOL_PROPERTIES, or PROXOOL_XML)



PROXOOL_PREFIX
final public static String PROXOOL_PREFIX(Code)
Proxool/Hibernate property prefix



PROXOOL_PROPERTIES
final public static String PROXOOL_PROPERTIES(Code)
Proxool property to configure the Proxool Provider using a properties file (/path/to/proxool.properties)



PROXOOL_XML
final public static String PROXOOL_XML(Code)
Proxool property to configure the Proxool Provider using an XML (/path/to/file.xml)



QUERY_CACHE_FACTORY
final public static String QUERY_CACHE_FACTORY(Code)
The QueryCacheFactory implementation class.



QUERY_STARTUP_CHECKING
final public static String QUERY_STARTUP_CHECKING(Code)
Should named queries be checked during startup (the default is enabled).

Mainly intended for test environments.




QUERY_SUBSTITUTIONS
final public static String QUERY_SUBSTITUTIONS(Code)
A comma-seperated list of token substitutions to use when translating a Hibernate query to SQL



QUERY_TRANSLATOR
final public static String QUERY_TRANSLATOR(Code)
The classname of the HQL query parser factory



RELEASE_CONNECTIONS
final public static String RELEASE_CONNECTIONS(Code)
Specifies how Hibernate should release JDBC connections.



SESSION_FACTORY_NAME
final public static String SESSION_FACTORY_NAME(Code)
JNDI name to bind to SessionFactory



SHOW_SQL
final public static String SHOW_SQL(Code)
Enable logging of generated SQL to the console



SQL_EXCEPTION_CONVERTER
final public static String SQL_EXCEPTION_CONVERTER(Code)
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_SIZE
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



URL
final public static String URL(Code)
JDBC URL



USER
final public static String USER(Code)
JDBC user



USER_TRANSACTION
final public static String USER_TRANSACTION(Code)
JNDI name of JTA UserTransaction object



USE_GET_GENERATED_KEYS
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)



USE_MINIMAL_PUTS
final public static String USE_MINIMAL_PUTS(Code)
Optimize the cache for mimimal puts instead of minimal gets



USE_QUERY_CACHE
final public static String USE_QUERY_CACHE(Code)
Enable the query cache (disabled by default)



USE_REFLECTION_OPTIMIZER
final public static String USE_REFLECTION_OPTIMIZER(Code)
Use bytecode libraries optimized property access



USE_SCROLLABLE_RESULTSET
final public static String USE_SCROLLABLE_RESULTSET(Code)
Use JDBC scrollable ResultSets. This property is only necessary when there is no ConnectionProvider, ie. the user is supplying JDBC connections.



USE_SECOND_LEVEL_CACHE
final public static String USE_SECOND_LEVEL_CACHE(Code)
Enable the second-level cache (enabled by default)



USE_SQL_COMMENTS
final public static String USE_SQL_COMMENTS(Code)
Add comments to the generated SQL



USE_STREAMS_FOR_BINARY
final public static String USE_STREAMS_FOR_BINARY(Code)
Use java.io streams to read / write binary data from / to JDBC



USE_STRUCTURED_CACHE
final public static String USE_STRUCTURED_CACHE(Code)
Enable use of structured second-level cache entries



VERSION
final public static String VERSION(Code)



WRAP_RESULT_SETS
final public static String WRAP_RESULT_SETS(Code)
Enable wrapping of JDBC result sets in order to speed up column name lookups for broken JDBC drivers





Method Detail
buildBytecodeProvider
public static BytecodeProvider buildBytecodeProvider(Properties properties)(Code)



getBytecodeProvider
public static BytecodeProvider getBytecodeProvider()(Code)



getProperties
public static Properties getProperties()(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?



jvmHasTimestampBug
public static boolean jvmHasTimestampBug()(Code)
Does this JVM have the IBM JDK 1.3.1. The bug is new Timestamp(x).getTime()!=x.



jvmSupportsGetGeneratedKeys
public static boolean jvmSupportsGetGeneratedKeys()(Code)



jvmSupportsLinkedHashCollections
public static boolean jvmSupportsLinkedHashCollections()(Code)
Does this JVM support LinkedHashSet, LinkedHashMap.
See Also:   java.util.LinkedHashSet
See Also:   java.util.LinkedHashMap



useReflectionOptimizer
public static boolean useReflectionOptimizer()(Code)
Should we use CGLIB reflection optimizer. Property hibernate.jdbc.use_refection_optimizer.
See Also:   Environment.USE_REFLECTION_OPTIMIZER



useStreamsForBinary
public static boolean useStreamsForBinary()(Code)
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



verifyProperties
public static void verifyProperties(Properties props)(Code)
Issues warnings to the user when any obsolete property names are used.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.