文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Hibernate 管理二级缓存

Hibernate 管理二级缓存

时间:2010-10-22  来源:juxiangwu

1、SessionFactory对象的evict(Class arg0)方法可以从二级缓存中清除指定的持久化类的所有缓存对象,并释放其占用的资源。如:

sessionFactory.evict(Category.class);

2、SessionFactory对象的evictCollection(String arg0)方法可以从二级缓存中清除指定的集合对象的缓存。如:

sessionFactory.evictCollection("com.kkoolerter.example.Category.products");

3、SessionFactory对象的evictEntity(String arg0,Serializable arg1)方法可以从二级缓存中清除指定的持久化类的所有缓存对象。如:

sessionFacotry.evictEntity("com.kkoolerter.beans.Category",new Integer(1));

相关阅读 更多 +
排行榜 更多 +
PvZ戴夫的时空冒险重置

PvZ戴夫的时空冒险重置

策略塔防 下载
PVZTV雪版阳光加50

PVZTV雪版阳光加50

策略塔防 下载
双刃战士雪姐

双刃战士雪姐

冒险解谜 下载