Maven 多模块开发(6)-hibernate.cfg.xml

Maven 多模块开发(六)-hibernate.cfg.xml
  1. <?xml version='1.0' encoding='UTF-8'?>  
  2. <!DOCTYPE hibernate-configuration PUBLIC  
  3.          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"  
  4.     "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">  
  5.   
  6. <hibernate-configuration>  
  7.     <session-factory>  
  8.   
  9.         <property name="dialect">org.hibernate.dialect.MySQLDialect</property>  
  10.         <property name="jdbc.batch_size">20</property>  
  11.         <property name="connection.autocommit">true</property>  
  12.   
  13.         <!-- 显示sql语句 -->  
  14.         <property name="show_sql">true</property>  
  15.         <property name="connection.useUnicode">true</property>  
  16.         <property name="connection.characterEncoding">UTF-8</property>  
  17.   
  18.         <!-- 缓存设置 ehcache.xml (可以到下载的hibernate文件目录(hibernate-release-4.3.4.Final\hibernate-release-4.3.4.Final\project\etc)下找-->  
  19.         <property name="cache.provider_configuration_file_resource_path">/ehcache.xml</property>  
  20.         <property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>  
  21.         <property name="cache.use_query_cache">true</property>  
  22.   
  23.     </session-factory>  
  24. </hibernate-configuration>