ssh框架 之 hibernate 之 hibernate.cfg.xml配置解析

hibernate配置文件hibernate.cfg.xml的详细解释




"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">





com.mysql.jdbc.Driver

jdbc:mysql://localhost/hibernate

root

123456

20

true

50

23

false

true

gbk


org.hibernate.dialect.MySQLDialect







class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
//连接驱动

//连接url,

//连接用户名

//连接密码



class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">


//hibernate配置文件位置
WEB-INF/hibernate.cfg.xml

value="org.hibernate.cfg.AnnotationConfiguration" />


//针对oracle数据库的方言,特定的关系数据库生成优化的SQL

org.hibernate.dialect.OracleDialect

//选择HQL解析器的实现

org.hibernate.hql.ast.ASTQueryTranslatorFactory

//是否在控制台打印sql语句
true
//在Hibernate系统参数中hibernate.use_outer_join被打开的情况下,该参数用来允许使用outer join来载入此集合的数据。
true
//默认打开,启用cglib反射优化。cglib是用来在Hibernate中动态生成PO字节码的,打开优化可以加快字节码构造的速度
true
//输出格式化后的sql,更方便查看
true
//“useUnicode”和“characterEncoding”决定了它是否在客户端和服务器端传输过程中进行Encode,以及如何进行Encode
true
//允许查询缓存, 个别查询仍然需要被设置为可缓存的.
false
16
//连接池的最大活动个数
100
//当连接池中的连接已经被耗尽的时候,DBCP将怎样处理(0 = 失败,1 = 等待,2 = 增长)
1
//最大等待时间
1200
//没有人用连接的时候,最大闲置的连接个数
10
##以下是对prepared statement的处理,同上。
100
1
1200
10


你可能感兴趣的:(hibernate)