【Java开源代码栏目提醒】:网学会员--在 Java开源代码编辑为广大网友搜集整理了:WbEmployee_ji9hxe__WebLogic_CMP_RDBMS_wbRole_Set.java绩等信息,祝愿广大网友取得需要的信息,参考学习。
/**
* This code was automatically generated at 15:51:48 on 2005-12-9
* by weblogic.ejb20.cmp.rdbms.codegen.ManyToManyGenerator -- do not edit.
*
* @version WebLogic Server 8.1 Fri Dec 5 15:01:51 PST 2003 316284
* @author Copyright (c) 2005 by BEA Systems, Inc. All Rights Reserved.
*/
package custom_management;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import java.util.Collection;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
import java.lang.reflect.Method;
import java.lang.reflect.Array;
import java.io.Serializable;
import java.io.IOException;
import javax.ejb.EJBObject;
import javax.ejb.EJBLocalObject;
import javax.ejb.EntityContext;
import javax.ejb.EJBException;
import javax.ejb.NoSuchEntityException;
import weblogic.ejb20.dd.DDConstants;
import weblogic.ejb20.interfaces.WLEnterpriseBean;
import weblogic.ejb20.persistence.spi.CMPBeanManager;
import weblogic.ejb20.persistence.spi.EoWrapper;
import weblogic.ejb20.persistence.spi.EloWrapper;
import weblogic.ejb20.persistence.spi.PersistenceRuntimeException;
import weblogic.ejb20.cmp.rdbms.RDBMSException;
import weblogic.ejb20.cmp.rdbms.RDBMSM2NSet;
import weblogic.ejb20.cmp.rdbms.RDBMSSet;
import weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager;
import weblogic.ejb20.cmp.rdbms.RDBMSUtils;
import weblogic.ejb20.EJBTextTextFormatter;
import weblogic.ejb20.EJBLogger;
import weblogic.logging.Loggable;
import weblogic.transaction.TransactionHelper;
import weblogic.utils.Debug;
public final class WbEmployee_ji9hxe__WebLogic_CMP_RDBMS_wbRole_Set implements RDBMSM2NSet, Set, Serializable,Cloneable {
// =================================================================
// Class variable(s)
private static final boolean __WL_debug =
(System.getProperty(RDBMSUtils.RDBMS_CODEGEN_DEBUG_PROP) != null);
private static final boolean __WL_verbose =
(System.getProperty(RDBMSUtils.RDBMS_CODEGEN_VERBOSE_PROP) != null);
private CMPBeanManager __WL_bm; // bean manager of the related target bean in this collection
private RDBMSPersistenceManager __WL_pm; // persistence manager of the bean that owns this collection
private custom_management.WbEmployee_ji9hxe_Intf __WL_creator;
private Method __WL_finder;
private Object __WL_createPk;
private EJBLocalObject __WL_createEo;
private Collection __WL_cache;
private boolean __WL_symmetric = false;
private boolean orderDatabaseOperations = false;// if this is 'True', then we defer all Join Table INSERTs
// to COMMIT time, we do *not* INSERT them here in this Set.
private Set __WL_addSet = null;;
private Transaction tx;
private Transaction __WL_createTx;
private boolean isCreatorBeanInvalidated = false;
public WbEmployee_ji9hxe__WebLogic_CMP_RDBMS_wbRole_Set(custom_management.WbEmployee_ji9hxe_Intf __WL_creator,
CMPBeanManager __WL_bm,
Method __WL_finder,
RDBMSPersistenceManager __WL_pm)
{
if (__WL_verbose) Debug.say("WbEmployee_ji9hxe__WebLogic_CMP_RDBMS_wbRole_Set() called.");
try {
this.__WL_bm = __WL_bm;
this.__WL_pm = __WL_pm;
this.__WL_creator = __WL_creator;
this.__WL_finder = __WL_finder;
EntityContext __WL_ctx = __WL_creator.__WL_getEntityContext();
__WL_createPk = __WL_ctx.getPrimaryKey();
__WL_createEo = __WL_ctx.getEJBLocalObject();
__WL_createTx = TransactionHelper.getTransactionHelper().getTransaction();
orderDatabaseOperations = __WL_pm.getOrderDatabaseOperations();
} catch (RuntimeException re) {
if (__WL_verbose) {
Debug.say("rethrowing RuntimeException.");
re.printStackTrace();
}
throw re;
} catch (Exception ex) {
if (__WL_verbose) {
Debug.say("wrapping Exception in PersistenceRuntimeException.");
ex.printStackTrace();
}
throw new PersistenceRuntimeException(ex);
}
}
private void populateCache()
{
if (__WL_verbose) Debug.say("populateCache() called.");
try {
if (__WL_debug) {
Debug.assertion(__WL_createPk !=null);
}
if (__WL_verbose) {
Debug.say("calling localWrapperSetFinder with pk: " + __WL_createPk);
}
isCreatorBeanInvalidated = false;
__WL_cache = __WL_bm.localWrapperSetFinder(__WL_finder, new Object[] {__WL_createPk});
if (orderDatabaseOperations) {
// add any cached ADDs to the __WL_cache
if (__WL_addSet != null) {
Set s = getAddSet();
Iterator it = s.iterator();
while (it.hasNext()) {
Object otherPK = it.next();
if (__WL_verbose)
Debug.say("WbEmployee_ji9hxe__WebLogic_CMP_RDBMS_wbRole_Set: adding from AddSet to __WL_cache: "+
"Join Table INSERT pk '"+otherPK+"'");
Object eo = __WL_bm.finderGetEoFromBeanOrPk(null, otherPK, true);
doAdd(eo);
}
}
}
} catch (RuntimeException re) {
if (__WL_verbose) {
Debug.say("rethrowing RuntimeException.");
re.printStackTrace();
}
throw re;
} catch (Exception ex) {
if (__WL_verbose) {
Debug.say("wrapping Exception in PersistenceRuntimeException.");
ex.printStackTrace();
}
throw new PersistenceRuntimeException(ex);
}
}
//======================================================================
//implementation of RDBMSM2NSet
public Object getCreatorPk() {
return __WL_createPk;
}
public void doAdd(Object o) {
if (__WL_verbose) Debug.say("doAdd() called.");
EJBLocalObject eo = (EJBLocalObject)o;
checkTransaction();
EloWrapper wrap = new EloWrapper(eo);
if (__WL_cache !=null) {
if (__WL_verbose) {
Debug.say("doAdd() adding to cached collection.");
}
if (__WL_debug) {
Debug.assertion(!__WL_cache.contains(wrap));
}
__WL_cache.add(wrap);
}
if(!isCreatorBeanInvalidated) {
__WL_pm.registerInvalidatedBean(__WL_createPk);
isCreatorBeanInvalidated = true;
}
}
public void doRemove(Object o) {
doRemove(o, true);
}
public void doRemove(Object o, boolean remove) {
if (__WL_verbose) Debug.say("doRemove() called.");
EJBLocalObject eo = (EJBLocalObject)o;
checkTransaction();
EloWrapper wrap = new EloWrapper(eo);
if (__WL_cache !=null) {
if (remove) {
if (__WL_debug) {
Debug.assertion(__WL_cache.contains(wrap));
}
if (__WL_verbose) {
Debug.say("doRemove() removing from cached collection.");
}
__WL_cache.remove(wrap);
}
}
if(!isCreatorBeanInvalidated) {
__WL_pm.registerInvalidatedBean(__WL_createPk);
isCreatorBeanInvalidated = true;
}
}
public void doAddToCache(Object o) { } // not used here. Used in One To Many Set only
public Set getAddSet() {
if (__WL_addSet != null) {
return __WL_addSet;
}
__WL_addSet = new HashSet();
return __WL_addSet;
}
//===================
上一篇:
WbEmployee_ji9hxe__WebLogic_CMP_RDBMS_wbRole_Iterator.java
下一篇:
下鼻甲不同术式对鼻黏膜纤毛功能的影响