📄 contact_gnsg8g__weblogic_cmp_rdbms.java
字号:
public java.sql.PreparedStatement[] __WL_getStmtArray(
java.sql.Connection conn,
boolean[] isModifiedVar,
int operation)
throws SQLException
{
return null;
}
public void __WL_setBeanParamsForStmtArray(
java.sql.PreparedStatement[] __WL_stmt_array,
boolean[] isModifiedVar,
int operation)
throws Exception
{
}
public void __WL_setIsModifiedVars(boolean __WL_isModifiedFlag,
java.sql.Connection conn)
throws Exception
{
}
public void __WL_perhapsTakeSnapshot()
{
}
public void __WL_checkExistsOnMethod() throws NoSuchEntityException
{
}
public boolean __WL_isModifiedOrLoaded()
{
throw new AssertionError(
"__WL_isModifiedOrLoaded should not be called for a 1.1 CMP bean.");
}
public boolean __WL_exists(Object __WL_key) {
if (__WL_verbose) {
System.out.println("Contact_gnsg8g__WebLogic_CMP_RDBMS.exists: " + __WL_key);
}
java.sql.Connection __WL_con = null;
java.sql.PreparedStatement __WL_stmt = null;
java.sql.ResultSet __WL_rs = null;
try {
java.lang.String __WL_pk = (java.lang.String) __WL_key;
__WL_con = __WL_pm.getConnection();
__WL_stmt = __WL_con.prepareStatement(
"select * from contact where LAST = ?");
// preparedStatementParamIndex reset.
if(!__WL_pm.setParamNull(__WL_stmt, 1, __WL_pk, "last")) {
__WL_stmt.setString(1, __WL_pk);
if (__WL_verbose) {
Debug.say("paramIdx :"+1+" binded with value :"+__WL_pk);
}
}
__WL_rs = __WL_stmt.executeQuery();
if (__WL_rs.next()) {
if (__WL_verbose) System.out.println("exists returning true");
return true;
}
else {
if (__WL_verbose) System.out.println("exists returning false");
return false;
}
} catch (RuntimeException e) {
if (__WL_debug) System.out.println("throwing runtime exception");
throw e;
}
catch (Exception ex) {
if (__WL_debug) System.out.println("throwing ejbeception");
throw new PersistenceRuntimeException(ex);
}
finally {
__WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
}
}
public void __WL_setBeanState(short val) {
throw new AssertionError(
"Optimistic concurrency is not supported for 1.1 CMP");
}
public short __WL_getBeanState() {
throw new AssertionError(
"Optimistic concurrency is not supported for 1.1 CMP");
}
public boolean __WL_getIsRemoved() { return __WL_isRemoved; }
public void __WL_setIsRemoved(boolean b) { __WL_isRemoved = b; }
public int __WL_appendVerifySqlForBatch(java.util.List verifyPk,
StringBuffer[] verifySql,
int[] verifyCount,
int verifyMax)
{
throw new AssertionError(
"__WL_appendVerifySqlForBatch should not be called on a 1.1 CMP bean.");
}
public void __WL_setVerifyParamsForBatch(java.sql.Connection con,
java.sql.PreparedStatement[] verifyStmt,
int[] verifyCount)
{
throw new AssertionError(
"__WL_setVerifyParamsForBatch should not be called on a 1.1 CMP bean.");
}
public int __WL_appendVerifySql(java.util.List verifyPk,
StringBuffer[] verifySql,
int[] verifyCount,
int verifyMax)
{
throw new AssertionError(
"appendVerifySql should not be called on a 1.1 CMP bean.");
}
public void __WL_setVerifyParams(java.sql.Connection con,
java.sql.PreparedStatement[] verifyStmt,
int[] verifyCount)
{
throw new AssertionError(
"setVerifyParams should not be called on a 1.1 CMP bean.");
}
/**
* Used in EJB2.0 Many To Many relationships only
*/
public String __WL_getM2NSQL(String cmrf, int operation)
{
return "";
}
/**
* Used in EJB2.0 Many To Many relationships only
*/
public Collection __WL_getCmrBeansForCmrField(String cmrf)
{
return null;
}
//=================================================================
//Finder methods.
public java.lang.Object ejbFindByPrimaryKey(java.lang.String param0) throws javax.ejb.FinderException
{
if(__WL_verbose) {
Debug.say("Contact_gnsg8g__WebLogic_CMP_RDBMS.findByPrimaryKey");
}
java.sql.Connection __WL_con = null;
java.sql.PreparedStatement __WL_stmt = null;
java.sql.ResultSet __WL_rs = null;
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: " +
RDBMSUtils.throwable2StackTrace(e));
}
String selectForUpdate = __WL_pm.selectForUpdate();
java.lang.String __WL_query =
"SELECT LAST, FIRST, EMAIL FROM contact WHERE (? = LAST)" + selectForUpdate;
if(__WL_verbose) {
System.out.println("Scalar Finder produced statement string "
+ __WL_query);
}
cmp1bean.Contact_gnsg8g__WebLogic_CMP_RDBMS __WL_bean = null;
Object __WL_eo = null;
try {
__WL_stmt = __WL_con.prepareStatement(__WL_query);
// preparedStatementParamIndex reset.
if (param0 == null) {
__WL_stmt.setNull(1,12);
} else
__WL_stmt.setString(1, param0);
__WL_rs = __WL_stmt.executeQuery();
if (__WL_rs.next()) {
Object __WL_pk = __WL_getPKFromRS(__WL_rs);
RSInfo __WL_rsInfo = new RSInfoImpl(__WL_rs, 0, 0);
__WL_bean = (cmp1bean.Contact_gnsg8g__WebLogic_CMP_RDBMS)__WL_pm.getBeanFromRS(__WL_pk, __WL_rsInfo);
__WL_eo = __WL_pm.finderGetEoFromBeanOrPk(__WL_bean, __WL_pk, __WL_getIsLocal());
} else {
if(__WL_verbose) {
Debug.say("Throwing FinderException because " +
"bean wasn't found.");
}
Loggable l = EJBLogger.logbeanNotFoundLoggable("findByPrimaryKey");
throw new javax.ejb.ObjectNotFoundException(l.getMessage());
}
if (__WL_rs.next()) {
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 +
RDBMSUtils.throwable2StackTrace(sqle));
} catch (Exception e) {
throw new javax.ejb.FinderException(
"Exception raised in findByPrimaryKey " + EOL +
RDBMSUtils.throwable2StackTrace(e));
} finally {
__WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
}
}
public static Object __WL_getPKFromRS(java.sql.ResultSet __WL_rs)
throws java.sql.SQLException, java.lang.Exception
{
java.lang.String __WL_pk = null;
__WL_pk = (java.lang.String)__WL_rs.getString(1);
if (__WL_rs.wasNull()) { __WL_pk = null; }
return __WL_pk;
}
public Object __WL_getPKFromRSInstance(java.sql.ResultSet __WL_rs, java.lang.Integer offset, ClassLoader cl)
throws java.sql.SQLException, java.lang.Exception
{
return __WL_getPKFromRS(__WL_rs);
}
//End finder methods.
//=================================================================
//=================================================================
//Home methods.
//End home methods.
//=================================================================
//=================================================================
// implementation of javax.ejb.EntityBean
public void ejbPostCreate(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)
throws javax.ejb.CreateException
{
int oldState = __WL_method_state;
try {
__WL_method_state = STATE_EJB_POSTCREATE;
// No return value
super.ejbPostCreate( arg0, arg1, arg2);
// No return result
} finally {
__WL_method_state = oldState;
}
}
public void ejbPostCreate(java.lang.String arg0)
throws javax.ejb.CreateException
{
int oldState = __WL_method_state;
try {
__WL_method_state = STATE_EJB_POSTCREATE;
// No return value
super.ejbPostCreate( arg0);
// No return result
} 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;
}
}
public void ejbPassivate()
{
int oldState = __WL_method_state;
try {
__WL_method_state = STATE_EJB_PASSIVATE;
super.ejbPassivate();
__WL_initialize();
__WL_clear_snapshot_variables();
} finally {
__WL_method_state = oldState;
}
}
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 java.lang.String ejbCreate(java.lang.String arg0)
throws javax.ejb.CreateException {
int oldState = __WL_method_state;
try {
__WL_method_state = STATE_EJB_CREATE;
__WL_initialize();
super.ejbCreate(arg0);
try {
return (java.lang.String)__WL_create();
} catch (javax.ejb.CreateException ce) {
System.out.println("throwing create exception.");
throw ce;
} catch (RuntimeException e) {
if (__WL_debug) System.out.println("throwing runtime exception");
throw e;
}
catch (Exception ex) {
if (__WL_debug) System.out.println("throwing ejbeception");
throw new PersistenceRuntimeException(ex);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -