Chinaunix首页 | 论坛 | 博客
  • 博客访问: 871263
  • 博文数量: 322
  • 博客积分: 6688
  • 博客等级: 准将
  • 技术积分: 3626
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-19 11:26
文章分类

全部博文(322)

文章存档

2013年(5)

2012年(66)

2011年(87)

2010年(164)

分类: Java

2010-09-19 14:39:09

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.)
hibernate.query.substitutions query language token substitutions
阅读(736) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~