hibernate4 二级缓吹逆demo实例.docVIP

  • 3
  • 0
  • 约1.1万字
  • 约 10页
  • 2017-08-20 发布于浙江
  • 举报
hibernate4 二级缓吹逆demo实例

hibernate4 二级缓存demo实例 hibernate使用版本是:hibernate-release-4.2.5.Final 需要的jar包:hibernate-release-4.2.5.Final\lib\required下所有jar包 ehcache jar包:hibernate-release-4.2.5.Final\lib\optional\ehcache下所有包 junit:junit-4.10.jar和mysql-connector-java-5.1.15-bin.jar 注:hibernate 4.2.5版本ehcache缓存不依赖commons-logging-1.1.1.jar,需要的是slf4j-api-1.6.1.jar 项目结构如下 hibernate.cfg.xml ?xml version=1.0 encoding=utf-8? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD 3.0//EN /dtd/hibernate-configuration-3.0.dtd hibernate-configuration session-factory !-- Database connection settings -- property name=connection.driver_classcom.mysql.jdbc.Driver/property property name=connection.urljdbc:mysql://:3306/hibernate4/property property name=connection.usernameroot/property property name=connection.passwordroot/property !-- JDBC connection pool (use the built-in) -- property name=connection.pool_size1/property !-- SQL dialect -- property name=dialectorg.hibernate.dialect.MySQL5Dialect/property !-- Enable Hibernates automatic session context management -- property name=current_session_context_classthread/property !-- Disable the second-level cache -- !--property name=vider_classernal.NoCacheProvider/property -- !-- 配置二级缓存 -- property name=hibernate.cache.use_second_level_cachetrue/property property name=hibernate.cache.region.factory_classorg.hibernate.cache.ehcache.EhCacheRegionFactory/property !-- hibernate3的二级缓存配置 -- !-- property name=vider_classorg.hibernate.cache.EhCacheProvider/property -- !-- 开启查询缓存 -- property name=hibernate.cache.use_query_cachetrue/property !-- Echo all executed SQL to stdout -- property name=show_sqltrue/property !-- Drop and re-create the database schema on startup -- property name=hbm2ddl.autoupdate/property mappi

文档评论(0)

1亿VIP精品文档

相关文档