address_n6e4pc__weblogic_cmp_rdbms.java
来自「100多M的J2EE培训内容」· Java 代码 · 共 2,339 行 · 第 1/5 页
JAVA
2,339 行
this.state = state;
__WL_isModified[4] = true;
if (! __WL_modifiedBeanIsRegistered) {
__WL_pm.registerModifiedBean(__WL_ctx.getPrimaryKey());
__WL_modifiedBeanIsRegistered = true;
}
}
public java.lang.String getStudentID()
{
try {
if (!(__WL_isLoaded[5] || __WL_isModified[5])) {
__WL_loadGroup0();
}
return studentID;
} 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);
}
}
public void setStudentID(
java.lang.String studentID)
{
Loggable l = EJBLogger.logcannotCallSetOnCmpCmrFieldLoggable();throw new EJBException(l.getMessage());
}
public cmpsample.Student getStudentBean_address() { try {
if (!__WL_isLoaded[5]) __WL_loadGroup0();
if (__WL_studentBean_address_field_==null) {
if (!(studentID==null)) {
Transaction orgTx =
TransactionHelper.getTransactionHelper().getTransaction();
try {
__WL_studentBean_address_field_ = (cmpsample.Student)__WL_studentBean_address_bm.localFindByPrimaryKey( __WL_studentBean_address_finder_, this.studentID);
} finally {
}
}
}
return __WL_studentBean_address_field_;
} 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);
}
}public void setStudentBean_address(cmpsample.Student studentBean_address) {if (__WL_method_state==STATE_EJB_CREATE) {Loggable l = EJBLogger.logsetCheckForCmrFieldDuringEjbCreateLoggable();throw new IllegalStateException(l.getMessage());}__WL_setStudentBean_address(studentBean_address, false);}public void __WL_setStudentBean_address(cmpsample.Student studentBean_address, boolean ejbStore) {__WL_setStudentBean_address(studentBean_address, ejbStore, true);}// The flag 'remove' controls whether the Relationship's// underlying __WL_cache does a remove() operation.// If an Iterator of the __WL_cache is used to effect a remove()// then we must be sure to not to do a__WL_cache.remove()// that is the intended use of the 'remove' flag.public void __WL_setStudentBean_address(cmpsample.Student studentBean_address, boolean ejbStore, boolean remove) { try {
if (!__WL_isLoaded[5]) __WL_loadGroup0();
if (!(studentID==null)) {
cmpsample.Student_z53p80_Intf __WL_bean =
(cmpsample.Student_z53p80_Intf)__WL_studentBean_address_bm.lookup(this.studentID);
int oldState = __WL_bean.__WL_getMethodState();
try {
__WL_bean.__WL_setMethodState(WLEnterpriseBean.STATE_BUSINESS_METHOD);
RDBMSSet __WL_collection = (RDBMSSet)
__WL_bean.getAddress();
__WL_collection.doRemove(__WL_ctx.getEJBLocalObject(), remove);
} finally {
__WL_bean.__WL_setMethodState(oldState);
}
}
__WL_doSetStudentBean_address(studentBean_address);
__WL_postSetStudentBean_address();
if (ejbStore) ejbStore();
} 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 __WL_postSetStudentBean_address() throws java.lang.Exception { if (!(studentID==null)) {
cmpsample.Student_z53p80_Intf __WL_bean = (cmpsample.Student_z53p80_Intf)
__WL_studentBean_address_bm.lookup(this.studentID);
int oldState = __WL_bean.__WL_getMethodState();
try {
__WL_bean.__WL_setMethodState(WLEnterpriseBean.STATE_BUSINESS_METHOD);
if ((__WL_bean.__WL_beanIsLoaded() && __WL_bean.__WL_getIsRemoved()) ||
(!__WL_bean.__WL_beanIsLoaded() && !__WL_bean.__WL_exists(this.studentID))) {
Loggable l = EJBLogger.logillegalAttemptToAssignRemovedBeanToCMRFieldLoggable(
this.studentID.toString());
throw new IllegalArgumentException(l.getMessage());
}
RDBMSSet __WL_collection = (RDBMSSet)
__WL_bean.getAddress();
__WL_collection.doAdd(__WL_ctx.getEJBLocalObject());
} finally {
__WL_bean.__WL_setMethodState(oldState);
}
}
}public void __WL_doSetStudentBean_address(cmpsample.Student studentBean_address) { try {
if (!__WL_isLoaded[5]) __WL_loadGroup0();
if (__WL_verbose) {
Debug.say("[" + __WL_ctx.getPrimaryKey() +
"]called __WL_doSetStudentBean_address...");
}
__WL_studentBean_address_field_ = studentBean_address;
if (__WL_studentBean_address_field_ == null) {
if (__WL_verbose) {
Debug.say("setting field variable to null.");
}
studentID = null;__WL_isModified[5] = true;
}
else {
if (__WL_verbose) {
Debug.say("setting field variable to new value.");
}
studentID = (java.lang.String)__WL_studentBean_address_field_.getPrimaryKey();__WL_isModified[5] = true;
}
if (! __WL_modifiedBeanIsRegistered) {
__WL_pm.registerModifiedBean(__WL_ctx.getPrimaryKey());
__WL_modifiedBeanIsRegistered = true;
}
} 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);
}
}public void __WL_add__WL_studentBean_address_field_(Object studentBean_address) {if (studentBean_address != null) {__WL_studentBean_address_field_ = (cmpsample.Student) studentBean_address;}__WL_studentBean_address_isLoaded_ = true;}
//=================================================================
//Finder methods.
public java.lang.Object ejbFindByPrimaryKey(java.lang.String param0) throws javax.ejb.FinderException
{ if(__WL_verbose) {
Debug.say("called findByPrimaryKey.");
}
java.sql.Connection __WL_con = null;
java.sql.PreparedStatement __WL_stmt = null;
java.sql.ResultSet __WL_rs = null;
int __WL_offset = 0;
cmpsample.Address_n6e4pc__WebLogic_CMP_RDBMS __WL_bean = null;Object __WL_eo = null;Object __WL_eo_rc = null;
int selectForUpdateVal = __WL_pm.getSelectForUpdateValue();
java.lang.String __WL_query = null;
switch(selectForUpdateVal) {
case DDConstants.SELECT_FOR_UPDATE_DISABLED:
__WL_query = "SELECT WL0.addressID, WL0.city, WL0.state, WL0.street, WL0.studentID, WL0.zip FROM address WL0 WHERE ( WL0.addressID = ? )";
break;
case DDConstants.SELECT_FOR_UPDATE:
__WL_query = "SELECT WL0.addressID, WL0.city, WL0.state, WL0.street, WL0.studentID, WL0.zip FROM address WL0 WHERE ( WL0.addressID = ? ) FOR UPDATE ";
break;
case DDConstants.SELECT_FOR_UPDATE_NO_WAIT:
__WL_query = "SELECT WL0.addressID, WL0.city, WL0.state, WL0.street, WL0.studentID, WL0.zip FROM address WL0 WHERE ( WL0.addressID = ? ) FOR UPDATE NOWAIT ";
break;
default:
throw new AssertionError(
"Unknown selectForUpdate type: '"+selectForUpdateVal+"'");
}
if(__WL_verbose) {
Debug.say("Finder produced statement string " + __WL_query);
}
try {
__WL_con = __WL_pm.getConnection();
}
catch (java.lang.Exception e) {
__WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
throw new javax.ejb.FinderException("Couldn't get connection: " + EOL +
e.toString() + EOL +
RDBMSUtils.throwable2StackTrace(e));
}
try {
__WL_stmt = __WL_con.prepareStatement(__WL_query);
// preparedStatementParamIndex reset.
if (param0 == null) {__WL_stmt.setNull(1,java.sql.Types.VARCHAR);} else {__WL_stmt.setString(1, param0);if (__WL_verbose) {Debug.say("paramIdx :"+1+" binded with value :"+param0);}}
__WL_rs = __WL_stmt.executeQuery();
Map __WL_pkMap = new HashMap();
boolean __WL_isMulti = false;
while (__WL_rs.next()) {
Integer __WL_offsetIntObj = new Integer(0);Object __WL_pk = __WL_getPKFromRS(__WL_rs, __WL_offsetIntObj, __WL_classLoader);__WL_eo = null;if (__WL_pk != null) { RSInfo __WL_rsInfo = new RSInfoImpl(__WL_rs, 0, 0);__WL_bean = (cmpsample.Address_n6e4pc__WebLogic_CMP_RDBMS)__WL_pm.getBeanFromRS(__WL_pk, __WL_rsInfo);__WL_eo = __WL_pm.finderGetEoFromBeanOrPk(__WL_bean, __WL_pk, __WL_getIsLocal());if (__WL_verbose) Debug.say("bean after finder load: " + __WL_bean);Object __WL_retVal = __WL_pkMap.put(__WL_pk, __WL_bean);if (__WL_retVal!=null) __WL_isMulti=true;}
}
if (__WL_pkMap.size() == 0) {
if(__WL_verbose) {
Debug.say("Throwing FinderException because bean wasn't found.");
}
throw new javax.ejb.ObjectNotFoundException("Bean with primary key '" + param0.toString() + "' was not found by 'findByPrimaryKey'.");
}
if (__WL_isMulti || __WL_pkMap.size() > 1) {
Loggable l = EJBLogger.logfinderReturnedMultipleValuesLoggable("findByPrimaryKey");
throw new javax.ejb.FinderException(l.getMessage());
}
return __WL_eo;
} catch (javax.ejb.FinderException fe) {
throw fe;
} catch (java.sql.SQLException sqle) {
throw new javax.ejb.FinderException(
"Problem in findByPrimaryKey while preparing or executing " +
"statement: '" +
__WL_stmt + "': " + EOL +
sqle.toString() + EOL +
RDBMSUtils.throwable2StackTrace(sqle));
} catch (Exception e) {
throw new javax.ejb.FinderException(
"Exception raised in findByPrimaryKey " + EOL +
e.toString() + EOL +
RDBMSUtils.throwable2StackTrace(e));
} finally {
__WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
}
}public java.util.Collection ejbFindByStudent_z53p80__WebLogic_CMP_RDBMS_address__WL_
(java.lang.String param0
) throws java.lang.Exception
{ if(__WL_verbose) {
Debug.say("called findByStudent_z53p80__WebLogic_CMP_RDBMS_address__WL_");
}
java.sql.Connection __WL_con = null;
java.sql.PreparedStatement __WL_stmt = null;
java.sql.ResultSet __WL_rs = null;
int __WL_offset = 0;
int selectForUpdateVal = __WL_pm.getSelectForUpdateValue();
java.lang.String __WL_query = null;
switch(selectForUpdateVal) {
case DDConstants.SELECT_FOR_UPDATE_DISABLED:
__WL_query = "SELECT WL0.addressID, WL0.city, WL0.state, WL0.street, WL0.studentID, WL0.zip FROM address WL0 WHERE ( WL0.studentID = ? )";
break;
case DDConstants.SELECT_FOR_UPDATE:
__WL_query = "SELECT WL0.addressID, WL0.city, WL0.state, WL0.street, WL0.studentID, WL0.zip FROM address WL0 WHERE ( WL0.studentID = ? ) FOR UPDATE ";
break;
case DDConstants.SELECT_FOR_UPDATE_NO_WAIT:
__WL_query = "SELECT WL0.addressID, WL0.city, WL0.state, WL0.street, WL0.studentID, WL0.zip FROM address WL0 WHERE ( WL0.studentID = ? ) FOR UPDATE NOWAIT ";
break;
default:
throw new AssertionError(
"Unknown selectForUpdate type: '"+selectForUpdateVal+"'");
}
if(__WL_verbose) {
Debug.say("Finder produced statement string " + __WL_query);
}
try {
__WL_con = __WL_pm.getConnection();
}
catch (java.lang.Exception e) {
__WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
throw new javax.ejb.FinderException("Couldn't get connection: " + EOL +
e.toString() + EOL +
RDBMSUtils.throwable2StackTrace(e));
}
try {
__WL_stmt = __WL_con.prepareStatement(__WL_query);
// preparedStatementParamIndex reset.
if (param0 == null) {__WL_stmt.setNull(1,java.sql.Types.VARCHAR);} else {__WL_stmt.setString(1, param0);if (__WL_verbose) {Debug.say("paramIdx :"+1+" binded with value :"+param0);}}
__WL_rs = __WL_stmt.executeQuery();
}
catch (java.lang.Exception e) {
__WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
throw new javax.ejb.FinderException(
"Exception in findByStudent_z53p80__WebLogic_CMP_RDBMS_address__WL_ while preparing or executing " +
"statement: '" + __WL_stmt + "'" + EOL +
e.toString() + EOL +
RDBMSUtils.throwable2StackTrace(e));
}
try {
java.util.Collection __WL_collection = new java.util.ArrayList();cmpsample.Address_n6e4pc__WebLogic_CMP_RDBMS __WL_bean = null;Object __WL_eo = null;Object __WL_eo_rc = null;
Map __WL_pkMap = new HashMap();
while (__WL_rs.next()) {
Integer __WL_offsetIntObj = new Integer(0);Object __WL_pk = __WL_getPKFromRS(__WL_rs, __WL_offsetIntObj, __WL_classLoader);__WL_eo = null;if (__WL_pk != null) { RSInfo __WL_rsInfo = new RSInfoImpl(__WL_rs, 0, 0);__WL_bean = (cmpsample.Address_n6e4pc__WebLogic_CMP_RDBMS)__WL_pm.getBeanFromRS(__WL_pk, __WL_rsInfo);__WL_eo = __WL_pm.finderGetEoFromBeanOrPk(__WL_bean, __WL_pk, __WL_getIsLocal());if (__WL_verbose) Debug.say("bean after finder load: " + __WL_bean);__WL_collection.add(__WL_eo);Object __WL_retVal = __WL_pkMap.put(__WL_pk, __WL_bean);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?