<property name="cache.user_second_level_cache"> true</property>
<property name="cache_provider_class">org.hibernate.cache.EhCacheProvider</property>
需要导入ehcache.xml//一些参数自己去猜想
还需要common-logging-1,1,1.jar
@Cache(usage=CacheConcurrencyStategy.READ_WRITE,region,include) 详细见hibernate文档
region 对应ehcache.xml里的默认的配置
使用查询缓存
<property name="cache.use_query_cache">true</property>//需要query语句一模一样才行!
三种缓存算法 LRU,LFU,FIFO
memoryStoreEvictionPolicy=‘LRU’//这个参数需要写在ehcache.xml文件里!
悲观锁
load(xxxx.class,1)//@version 一个私有变量 并拥有set、get方法