1.添加jar包
2.配置hibernate.cfg.xml ,
cache.provider_class
cache.use_second_level_cache
hibernate.cache.use_query_cache
3.etc目录,ehcache.xml文件复制到src
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
/>
4.指定缓存策略
<class name="com.zzzy.ch2.Student" table="STUDENT">
<cache usage="read-only"/>
</class>
2.配置hibernate.cfg.xml ,
cache.provider_class
cache.use_second_level_cache
hibernate.cache.use_query_cache
3.etc目录,ehcache.xml文件复制到src
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
/>
4.指定缓存策略
<class name="com.zzzy.ch2.Student" table="STUDENT">
<cache usage="read-only"/>
</class>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货