⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 evictvisitor.java

📁 用Java实现的23个常用设计模式源代码
💻 JAVA
字号:
//$Id: EvictVisitor.java,v 1.1.2.3 2003/11/21 09:46:26 oneovthafew Exp $
package net.sf.hibernate.impl;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.type.PersistentCollectionType;

/**
 * Evict any collections referenced by the object from the session cache. 
 * This will NOT pick up any collections that were dereferenced, so they 
 * will be deleted (suboptimal but not exactly incorrect).
 * 
 * @author Gavin King
 */
class EvictVisitor extends AbstractVisitor {

	EvictVisitor(SessionImpl session) {
		super(session);
	}

	Object processCollection(Object collection, PersistentCollectionType type)
		throws HibernateException {
		
		if (collection!=null) getSession().evictCollection(collection, type);
		
		return null;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -