码迷,mamicode.com
首页 > Web开发 > 详细

hibernate核心文件配置(位置固定src下面 名称hibernate.cfg.xml)

时间:2017-04-15 13:55:55      阅读:311      评论:0      收藏:0      [点我收藏+]

标签:cond   doctype   位置   http   generate   上下文   reg   jdbc   mod   

<?xml version=‘1.0‘ encoding=‘UTF-8‘?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/book1
</property>
<property name="connection.username">root</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">Test</property>
<!-- getCurentSsssion的session的上下文 -->
<property name="current_session_context_class">thread</property>
<!-- 二级缓存 -->
<property name="cache.use_second_level_cache">true</property>
<property name="hibernate.cache.region.factory_class">
org.hibernate.cache.ehcache.EhCacheRegionFactory
</property>
<property name="javax.persistence.validation.mode">none</property>
<!--查询缓存 -->
<property name="cache.use_query_cache">true</property>
<mapping resource="com/yuntu/entity/Booktype.hbm.xml" />
<mapping resource="com/yuntu/entity/Book.hbm.xml" />

</session-factory>

</hibernate-configuration>

hibernate核心文件配置(位置固定src下面 名称hibernate.cfg.xml)

标签:cond   doctype   位置   http   generate   上下文   reg   jdbc   mod   

原文地址:http://www.cnblogs.com/dawn-and-night/p/6713733.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!