scheduledcollectionremove.java

来自「用Java实现的23个常用设计模式源代码」· Java 代码 · 共 35 行

JAVA
35
字号
//$Id: ScheduledCollectionRemove.java,v 1.7.2.5 2003/11/05 09:01:29 oneovthafew Exp $package net.sf.hibernate.impl;import java.io.Serializable;import net.sf.hibernate.HibernateException;import net.sf.hibernate.collection.CollectionPersister;import net.sf.hibernate.engine.SessionImplementor;final class ScheduledCollectionRemove extends ScheduledCollectionAction implements SessionImpl.Executable {		private boolean emptySnapshot;		public ScheduledCollectionRemove(CollectionPersister persister, Serializable id, boolean emptySnapshot, SessionImplementor session) {		super(persister, id, session);		this.emptySnapshot = emptySnapshot;	}		public void execute() throws HibernateException {		CollectionPersister persister = getPersister();		if ( persister.hasCache() ) setLock( persister.getCache().lock( getId() ) );		if (!emptySnapshot) persister.remove( getId(), getSession() );		if ( persister.hasCache() ) persister.getCache().evict( getId() );	}		}

⌨️ 快捷键说明

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