📄 goodscategorybean_75x3ro__weblogic_cmp_rdbms.java
字号:
/**
* This code was automatically generated at 23:19:08 on 2004-6-16
* by weblogic.ejb20.cmp.rdbms.codegen.RDBMSCodeGenerator -- do not edit.
*
* @version WebLogic Server 7.0 Thu Apr 25 17:16:22 PDT 2002 180709
* @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
*/
package stockmanagementpro;
import java.lang.reflect.Method;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.io.IOException;
import javax.ejb.EntityContext;
import javax.ejb.EJBException;
import javax.ejb.EJBObject;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.NoSuchEntityException;
import javax.ejb.Handle;
import javax.ejb.HomeHandle;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingEnumeration;
import javax.naming.NameClassPair;
import javax.rmi.PortableRemoteObject;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import weblogic.ejb.OptimisticConcurrencyException;
import weblogic.ejb20.InternalException;
import weblogic.ejb20.internal.EJBRuntimeUtils;
import weblogic.ejb20.interfaces.WLEnterpriseBean;
import weblogic.ejb20.interfaces.CachingManager;
import weblogic.ejb20.persistence.spi.CMPBean;
import weblogic.ejb20.persistence.spi.CMPBeanManager;
import weblogic.ejb20.persistence.spi.PersistenceManager;
import weblogic.ejb20.persistence.spi.PersistenceRuntimeException;
import weblogic.ejb20.cmp.rdbms.ExternalLoader;
import weblogic.ejb20.cmp.rdbms.RDBMSObjectInputStream;
import weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager;
import weblogic.ejb20.cmp.rdbms.RDBMSException;
import weblogic.ejb20.cmp.rdbms.RDBMSUtils;
import weblogic.ejb20.cmp.rdbms.RDBMSSet;
import weblogic.utils.AssertionError;
import weblogic.utils.Debug;
public final class GoodsCategoryBean_75x3ro__WebLogic_CMP_RDBMS extends stockmanagementpro.GoodsCategoryBean
implements CMPBean, ExternalLoader
{
// =================================================================
// 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 static String EOL = System.getProperty("line.separator");
private javax.ejb.EJBContext __WL_EJBContext;
private int __WL_method_state;
private short __WL_bean_state;
private boolean __WL_busy = false;
private int __WL_offset = 0;
public javax.transaction.Transaction __WL_getBeanManagedTransaction() {
throw new AssertionError("Entity beans can't have"
+ " bean-managed transactions");
}
public void __WL_setBeanManagedTransaction(javax.transaction.Transaction tx) {
throw new AssertionError("Entity beans can't have"
+ " bean-managed transactions");
}
public boolean __WL_isBusy() { return __WL_busy; }
public void __WL_setBusy(boolean b) { __WL_busy = b; }
public int __WL_getMethodState() { return __WL_method_state; }
public void __WL_setMethodState(int state) { __WL_method_state = state; }
public javax.ejb.EJBContext __WL_getEJBContext() { return __WL_EJBContext; }
public void __WL_setEJBContext(javax.ejb.EJBContext ctx) {
__WL_EJBContext = ctx;
}
// =================================================================
// ejbSelect Methods Defined on CMR Beans
// =================================================================
// Instance variable(s)
private EntityContext __WL_ctx;
private RDBMSPersistenceManager __WL_pm;private ClassLoader __WL_classLoader;
public java.lang.Integer categoryId; public int parentId; public java.lang.String categoryName; public java.lang.String categoryDescription;
private boolean[] __WL_isModified = new boolean[4];private boolean __WL_modifiedBeanIsRegistered= false;
private boolean[] __WL_isLoaded = new boolean[4];private boolean __WL_beanIsLoaded= false;
// for remote relationships
// =================================================================
// Constructor(s)
public GoodsCategoryBean_75x3ro__WebLogic_CMP_RDBMS() {
super();
__WL_initialize();
}
// This method is called by ejbLoad, ejbPassivate, and ejbRemove
// to initialize the persistent state of the bean and its associated
// variables.
public void __WL_initialize()
{
__WL_initialize_persistent();
__WL_beanIsLoaded = false;
__WL_modifiedBeanIsRegistered = false;
//cached relationship state
}
private void __WL_initialize_persistent()
{
for (int __WL_i = 0; __WL_i < 4; __WL_i++) {
__WL_isLoaded[__WL_i] = false;
__WL_isModified[__WL_i] = false;
}
parentId = 0;categoryDescription = null;categoryName = null;categoryId = null;
}
// ================================================================
// Method(s)
public void setEntityContext(javax.ejb.EntityContext arg0) {
int oldState = __WL_method_state;
try {
__WL_method_state = STATE_SET_CONTEXT;
super.setEntityContext(arg0);
this.__WL_ctx = arg0;
} finally {
__WL_method_state = oldState;
}
}
public void unsetEntityContext()
{
int oldState = __WL_method_state;
try {
__WL_method_state = STATE_UNSET_CONTEXT;
super.unsetEntityContext();
} finally {
__WL_method_state = oldState;
}
}
public void ejbActivate()
{
int oldState = __WL_method_state;
try {
__WL_method_state = STATE_EJB_ACTIVATE;
super.ejbActivate();
} finally {
__WL_method_state = oldState;
}
}
// ================================================================
// Getter and Setter methods.
public java.lang.Integer getCategoryId()
{
try {
if (!__WL_isLoaded[0]) {
__WL_loadGroup0();
}
return categoryId;
} 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 setCategoryId(
java.lang.Integer categoryId)
{
if (__WL_method_state!=STATE_EJB_CREATE) { throw new IllegalStateException("The setXXX method for a primary key field may only be called during ejbCreate."); } this.categoryId = categoryId;
__WL_isModified[0] = true;
if (! __WL_modifiedBeanIsRegistered) {
__WL_pm.registerModifiedBean(__WL_ctx.getPrimaryKey());
__WL_modifiedBeanIsRegistered = true;
}
}
public int getParentId()
{
try {
if (!__WL_isLoaded[1]) {
__WL_loadGroup0();
}
return parentId;
} 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 setParentId(
int parentId)
{
this.parentId = parentId;
__WL_isModified[1] = true;
if (! __WL_modifiedBeanIsRegistered) {
__WL_pm.registerModifiedBean(__WL_ctx.getPrimaryKey());
__WL_modifiedBeanIsRegistered = true;
}
}
public java.lang.String getCategoryName()
{
try {
if (!__WL_isLoaded[2]) {
__WL_loadGroup0();
}
return categoryName;
} 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 setCategoryName(
java.lang.String categoryName)
{
this.categoryName = categoryName;
__WL_isModified[2] = true;
if (! __WL_modifiedBeanIsRegistered) {
__WL_pm.registerModifiedBean(__WL_ctx.getPrimaryKey());
__WL_modifiedBeanIsRegistered = true;
}
}
public java.lang.String getCategoryDescription()
{
try {
if (!__WL_isLoaded[3]) {
__WL_loadGroup0();
}
return categoryDescription;
} 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 setCategoryDescription(
java.lang.String categoryDescription)
{
this.categoryDescription = categoryDescription;
__WL_isModified[3] = true;
if (! __WL_modifiedBeanIsRegistered) {
__WL_pm.registerModifiedBean(__WL_ctx.getPrimaryKey());
__WL_modifiedBeanIsRegistered = true;
}
}
//=================================================================
//Finder methods.
public java.util.Collection ejbFindAll() throws javax.ejb.FinderException{ if(__WL_verbose) {
Debug.say("called findAll");
}
java.sql.Connection __WL_con = null;
java.sql.PreparedStatement __WL_stmt = null;
java.sql.ResultSet __WL_rs = null;
String selectForUpdate = __WL_pm.selectForUpdate();
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 {
java.lang.String __WL_query = "SELECT WL0.categoryId, WL0.categoryDescription, WL0.categoryName, WL0.parentId FROM goodsCategory WL0 " + selectForUpdate;
if(__WL_verbose) {
Debug.say("Finder produced statement string " + __WL_query);
}
__WL_stmt = __WL_con.prepareStatement(__WL_query);
// preparedStatementParamIndex reset.
__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 findAll while preparing or executing " +
"statement: '" + __WL_stmt + "'" + EOL +
e.toString() + EOL +
RDBMSUtils.throwable2StackTrace(e));
}
try {
java.util.Collection __WL_collection = new java.util.ArrayList(); stockmanagementpro.GoodsCategoryBean_75x3ro__WebLogic_CMP_RDBMS __WL_bean = null;
Set __WL_pkSet = new HashSet();
while (__WL_rs.next()) {
Integer __WL_offsetIntObj = new Integer(0); Object __WL_pk = __WL_getPKFromRS(__WL_rs, __WL_offsetIntObj, __WL_classLoader); if (__WL_pk != null) { __WL_pkSet.add(__WL_pk); __WL_bean = (stockmanagementpro.GoodsCategoryBean_75x3ro__WebLogic_CMP_RDBMS)__WL_pm.getBeanFromPool(); __WL_bean.__WL_initialize(); __WL_bean = __WL_loadGroup0FromRS(__WL_rs, __WL_offsetIntObj, __WL_bean); if (__WL_verbose) Debug.say("bean after finder load: " + __WL_bean); __WL_collection.add(__WL_bean); }
}
return __WL_collection;
} catch (java.sql.SQLException sqle) {
throw new javax.ejb.FinderException(
"Exception in 'findAll' while using " +
"result set: '" + __WL_rs + "'" + EOL +
sqle.toString() + EOL +
RDBMSUtils.throwable2StackTrace(sqle));
} catch (java.lang.Exception e) {
throw new javax.ejb.FinderException(
"Exception executing finder 'findAll': " + EOL +
e.toString() + EOL +
RDBMSUtils.throwable2StackTrace(e));
} finally {
__WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
}
}public javax.ejb.EntityBean ejbFindByPrimaryKey(java.lang.Integer 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;
stockmanagementpro.GoodsCategoryBean_75x3ro__WebLogic_CMP_RDBMS __WL_bean = null;
String selectForUpdate = __WL_pm.selectForUpdate();
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 {
java.lang.String __WL_query = "SELECT WL0.categoryId, WL0.categoryDescription, WL0.categoryName, WL0.parentId FROM goodsCategory WL0 WHERE ( (WL0.categoryId = ?) ) " + selectForUpdate;
if(__WL_verbose) {
Debug.say("Finder produced statement string " + __WL_query);
}
__WL_stmt = __WL_con.prepareStatement(__WL_query);
// preparedStatementParamIndex reset.
if (param0 == null) { __WL_stmt.setNull(1,java.sql.Types.INTEGER); } else { __WL_stmt.setInt(1, param0.intValue()); }
__WL_rs = __WL_stmt.executeQuery();
Set __WL_pkSet = new HashSet();
while (__WL_rs.next()) {
Integer __WL_offsetIntObj = new Integer(0); Object __WL_pk = __WL_getPKFromRS(__WL_rs, __WL_offsetIntObj, __WL_classLoader); if (__WL_pk != null) { __WL_pkSet.add(__WL_pk); __WL_bean = (stockmanagementpro.GoodsCategoryBean_75x3ro__WebLogic_CMP_RDBMS)__WL_pm.getBeanFromPool(); __WL_bean.__WL_initialize(); __WL_bean = __WL_loadGroup0FromRS(__WL_rs, __WL_offsetIntObj, __WL_bean);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -