Hibernate配置文件:hibernate.cfg.xml常用属性说明
2016-10-12 21:17
591 查看
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- 数据库连接配置 --> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://localhost:3306/login</property> <property name="connection.username">root</property> <property name="connection.password">root</property> <!-- 数据库连接池的大小 --> <property name="connection.pool_size">1</property> <!-- 每次从数据库中取出并放到JDBC的Statement中的记录条数。Fetch Size设的越大,读数据库的次数越少,速度越快,Fetch Size越小,读数据库的次数越多,速度越慢--> <property name="jdbc.fetch_size">50 </property> <!--批量插入,删除和更新时每次操作的记录数。Batch Size越大,批量操作的向数据库发送Sql的次数越少,速度就越快,同样耗用内存就越大--> <property name="jdbc.batch_size">23 </property> <!-- SQL 方言 --> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <!-- Enable Hibernate's automatic session context management --> <property name="current_session_context_class">thread</property> <!-- 在控制台输出sql语句 --> <property name="show_sql">true</property> <property name="format_sql">true</property> <!-- 在启动时根据配置更新数据库 --> <property name="hbm2ddl.auto">update</property> <mapping class="com.star.model.User"/><!-- 注册我们的实体映射类--> </session-factory> </hibernate-configuration>
相关文章推荐
- hibernate配置文件:hibernate.cfg.xml常用属性
- hibernate.cfg.xml 中hbm2ddl.auto属性配置说明
- Hibernate3.5.4---java application的xml和annotation环境搭建(hibernate.cfg.xml配置文件说明,映射文件Student.hbm.xml说明
- Hibernate框架 主配置文件 Hibernate.cfg.xml 映射配置 说明
- Hibernate进阶篇(一)——hibernate.cfg.xml常用配置属性
- Hibernate3.5.4---java application的xml和annotation环境搭建(hibernate.cfg.xml配置文件说明,映射文件Student.hbm.xml说明
- 关于hibernate.cfg.xml配置文件的几点说明
- Hibernate3.5.4---java application的xml和annotation环境搭建(hibernate.cfg.xml配置文件说明,映射文件Student.hbm.xml说明)
- hibernate.cfg.xml文件的常用属性
- Hibernate.cgf.xml配置文件常用属性
- Hibernate框架中hibernate.properties属性文件,hibernate.cfg.xml配置文件,以及Users.hbm.xml映射文件的配置
- Hibernate的映射文件(hbm.xml)属性说明
- 根据hibernate.cfg.xml配置文件和相应实体类及其.hbm.xml文件生成对应的数据库表
- 在hibernate.cfg.xml文件中增加show_sql属性。
- hibernate配置文件hibernate.cfg.xml的详细解释
- Hibernate的映射文件(hbm.xml)属性说明
- Hibernate的hbm.xml文件中相关属性说明
- Hibernate.cfg.xml配置文件模板及解析
- hibernate配置文件--hibernate.cfg.xml
- 【配置文件】MySQL的hibernate.cfg.xml配置文件