欢迎来到天天文库
浏览记录
ID:25497714
大小:62.68 KB
页数:6页
时间:2018-11-20
《[计算机]hibernate3配置大全》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、Hibernate3的配置参数汇总SQL方言1、HibernateJDBC属性属性名用途hibernate.connection.driver_class jdbc驱动类hibernate.connection.url jdbcURLhibernate.connection.username 数据库用户hibernate.connection.password 数据库用户密码hibernate.connection.pool_size
2、 连接池容量上限数目注:使用C3P0的properties样例代码:hibernate.connection.driver_class=org.postgresql.Driverhibernate.connection.url=jdbc:postgresql://localhost/mydatabasehibernate.connection.username=myuserhibernate.connection.password=secrethibernate.c3p0.min_size=5
3、hibernate.c3p0.max_size=20hibernate.c3p0.timeout=1800hibernate.c3p0.max_statements=50hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect2、Hibernate的数据源属性属性名用途hibernate.connection.datasource 数据源JNDI名字hibernate.jndi.url J
4、NDI提供者的URL(可选)hibernate.jndi.class JNDIInitialContextFactory类(可选)hibernate.connection.username 数据库用户(可选)hibernate.connection.password 数据库用户密码(可选)注:应用程序服务器JNDI数据源的hibernate.properties样例代码:hibernate.connection.datasource=j
5、ava:/comp/env/jdbc/testhibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactoryhibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookuphibernate.dialect=org.hibernate.dialect.PostgreSQ
6、LDialect3、Hibernate配置属性(可选)属性名用途hibernate.dialect一个HibernateDialect类名允许Hibernate针对特定的关系数据库生成优化的SQL.取值full.classname.of.Dialecthibernate.show_sql输出所有SQL语句到控制台.取值true
7、falsehibernate.format_sql在log和console中打印出更漂亮的sql.取值true
8、falsehibernate.default_schema在生成的S
9、QL中,将给定的schema/tablespace附加于非全限定名的表名上.取值SCHEMA_NAMEhibernate.default_catalog在生成的SQL中,将给定的catalog附加于没全限定名的表名上.取值CATALOG_NAMEhibernate.session_factory_nameSessionFactory创建后,将自动使用这个名字绑定到JNDI中.取值jndi/composite/namehibernate.max_fetch_depth为单向关联(一对一,多对一)的外连接抓取
10、(outerjoinfetch)树设置最大深度.值为0意味着将关闭默认的外连接抓取.取值建议在0到3之间取值hibernate.default_batch_fetch_size为Hibernate关联的批量抓取设置默认数量.取值建议的取值为4,8,和16hibernate.default_entity_mode为由这个SessionFactory打开的所有Session指定默认的实体表现模式.取值dynamic-map,dom
此文档下载收益归作者所有