Student_z53p80__WebLogic_CMP_RDBMS_address_Iterator.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:3k
源码类别:
Java编程
开发平台:
Java
- /**
- * This code was automatically generated at 16:30:06 on 2003-8-29
- * by weblogic.ejb20.cmp.rdbms.codegen.OneToManyGenerator -- do not edit.
- *
- * @version WebLogic Server 8.1 Fri Jun 20 23:06:40 PDT 2003 271009
- * @author Copyright (c) 2003 by BEA Systems, Inc. All Rights Reserved.
- */
- package cmpsample;
- import java.util.Iterator;
- import java.util.Set;
- import javax.transaction.Transaction;
- import weblogic.ejb20.persistence.spi.EoWrapper;
- import weblogic.ejb20.persistence.spi.EloWrapper;
- import weblogic.ejb20.EJBTextTextFormatter;
- import weblogic.ejb20.EJBLogger;
- import weblogic.logging.Loggable;
- import weblogic.transaction.TransactionHelper;
- import weblogic.utils.Debug;
- public class Student_z53p80__WebLogic_CMP_RDBMS_address_Iterator implements Iterator {
- private EloWrapper currWrapper = null;
- private Iterator __WL_iter;
- private Student_z53p80__WebLogic_CMP_RDBMS_address_Set __WL_creator;
- private Transaction __WL_createTx;
- public Student_z53p80__WebLogic_CMP_RDBMS_address_Iterator(Iterator __WL_iter,
- Student_z53p80__WebLogic_CMP_RDBMS_address_Set __WL_creator)
- {
- this.__WL_iter = __WL_iter;
- this.__WL_creator = __WL_creator;
- this.__WL_createTx = __WL_creator.getTransaction();
- }
- public boolean hasNext()
- {
- checkTransaction();
- return __WL_iter.hasNext();
- }
- // Note: IllegalStateException checking for illegal
- // calls to next() and remove() are deferred to
- // the underlying Iterator.
- public Object next()
- {
- checkTransaction();
- currWrapper = (EloWrapper)__WL_iter.next();
- return currWrapper.getEJBLocalObject();
- }
- public void remove()
- {
- checkTransaction();
- __WL_iter.remove();
- if (null == currWrapper) {
- return;
- }
- __WL_creator.remove(currWrapper.getEJBLocalObject(),
- false, // do ejbStore()
- false); // do Collection.remove()
- }
- private void checkTransaction()
- {
- Transaction tx = TransactionHelper.getTransactionHelper().getTransaction();
- if (tx==null) {
- Loggable l = EJBLogger.logaccessedCmrIteratorOutsideTransactionLoggable("Student", "address");
- throw new IllegalStateException(
- l.getMessage());
- }
- if (!tx.equals(__WL_createTx) && ! false ) {
- Loggable l1 = EJBLogger.logaccessedCmrIteratorInDifferentTransactionLoggable("Student", "address");
- throw new IllegalStateException(l1.getMessage());
- }
- }
- }