flushvisitor.java

来自「介绍了hibernate的入门有一些基本常用的事例」· Java 代码 · 共 50 行

JAVA
50
字号
//$Id: FlushVisitor.java,v 1.7 2005/04/02 20:33:54 oneovthafew Exp $package org.hibernate.event.def;import org.hibernate.HibernateException;import org.hibernate.collection.PersistentCollection;import org.hibernate.engine.Collections;import org.hibernate.engine.SessionImplementor;import org.hibernate.type.CollectionType;/** * Process collections reachable from an entity. This * visitor assumes that wrap was already performed for * the entity. * * @author Gavin King */public class FlushVisitor extends AbstractVisitor {		private Object owner;	Object processCollection(Object collection, CollectionType type)	throws HibernateException {				if (collection==CollectionType.UNFETCHED_COLLECTION) {			return null;		}		if (collection!=null) {			final PersistentCollection coll;			if ( type.hasHolder( getSession().getEntityMode() ) ) {				coll = getSession().getPersistenceContext().getCollectionHolder(collection);			}			else {				coll = (PersistentCollection) collection;			}			Collections.processReachableCollection( coll, type, owner, getSession() );		}		return null;	}	FlushVisitor(SessionImplementor session, Object owner) {		super(session);		this.owner = owner;	}}

⌨️ 快捷键说明

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