📄 role_dtlbeanfunctionset_f0aaab38.java
字号:
package com.leeman.wkexs.master.rolemgt.dao.websphere_deploy.ORACLE_V9_1;import com.ibm.websphere.rsadapter.WSInteractionSpec;import com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException;import javax.resource.cci.Record;import javax.resource.cci.IndexedRecord;import java.sql.*;/** * Role_DtlBeanFunctionSet_f0aaab38 */public class Role_DtlBeanFunctionSet_f0aaab38 extends com.ibm.ws.rsadapter.cci.WSResourceAdapterBase implements com.ibm.websphere.rsadapter.DataAccessFunctionSet { private java.util.HashMap functionHash; /** * Create */ public void Create(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException { PreparedStatement pstmt = null; try { pstmt = prepareStatement(connection,"INSERT INTO WKEXS.ROLE_DTL (COMPANY_ID, ROLE_ID, PROGRAM_ID, PRIV_ID, ACTIVE) VALUES (?, ?, ?, ?, ?)"); // For column COMPANY_ID { String tempString; tempString=(String)inputRecord.get(0); if(tempString==null) pstmt.setNull(1,java.sql.Types.VARCHAR); else pstmt.setString(1,tempString); } // For column ROLE_ID { String tempString; tempString=(String)inputRecord.get(1); if(tempString==null) pstmt.setNull(2,java.sql.Types.VARCHAR); else pstmt.setString(2,tempString); } // For column PROGRAM_ID { String tempString; tempString=(String)inputRecord.get(2); if(tempString==null) pstmt.setNull(3,java.sql.Types.VARCHAR); else pstmt.setString(3,tempString); } // For column PRIV_ID { String tempString; tempString=(String)inputRecord.get(3); if(tempString==null) pstmt.setNull(4,java.sql.Types.VARCHAR); else pstmt.setString(4,tempString); } // For column ACTIVE { String tempString; tempString=(String)inputRecord.get(4); if(tempString==null) pstmt.setNull(5,java.sql.Types.VARCHAR); else pstmt.setString(5,tempString); } if (pstmt.executeUpdate()==0) throw new DataStoreAdapterException("DSA_ERROR",new javax.ejb.NoSuchEntityException(), this.getClass()); } catch (SQLException e) { throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass()); } finally { try { if(pstmt != null) { returnPreparedStatement(connection, pstmt); } } catch (SQLException ignored) {} } } /** * Remove */ public void Remove(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException { PreparedStatement pstmt = null; try { pstmt = prepareStatement(connection,"DELETE FROM WKEXS.ROLE_DTL WHERE COMPANY_ID = ? AND ROLE_ID = ? AND PROGRAM_ID = ? AND PRIV_ID = ?"); // For column COMPANY_ID { String tempString; tempString=(String)inputRecord.get(0); if(tempString==null) pstmt.setNull(1,java.sql.Types.VARCHAR); else pstmt.setString(1,tempString); } // For column ROLE_ID { String tempString; tempString=(String)inputRecord.get(1); if(tempString==null) pstmt.setNull(2,java.sql.Types.VARCHAR); else pstmt.setString(2,tempString); } // For column PROGRAM_ID { String tempString; tempString=(String)inputRecord.get(2); if(tempString==null) pstmt.setNull(3,java.sql.Types.VARCHAR); else pstmt.setString(3,tempString); } // For column PRIV_ID { String tempString; tempString=(String)inputRecord.get(3); if(tempString==null) pstmt.setNull(4,java.sql.Types.VARCHAR); else pstmt.setString(4,tempString); } if (pstmt.executeUpdate()==0) throw new DataStoreAdapterException("DSA_ERROR",new javax.ejb.NoSuchEntityException(), this.getClass()); } catch (SQLException e) { throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass()); } finally { try { if(pstmt != null) { returnPreparedStatement(connection, pstmt); } } catch (SQLException ignored) {} } } /** * Store */ public void Store(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException { PreparedStatement pstmt = null; try { pstmt = prepareStatement(connection,"UPDATE WKEXS.ROLE_DTL SET ACTIVE = ? WHERE COMPANY_ID = ? AND ROLE_ID = ? AND PROGRAM_ID = ? AND PRIV_ID = ?"); // For column COMPANY_ID { String tempString; tempString=(String)inputRecord.get(0); if(tempString==null) pstmt.setNull(2,java.sql.Types.VARCHAR); else pstmt.setString(2,tempString); } // For column ROLE_ID { String tempString; tempString=(String)inputRecord.get(1); if(tempString==null) pstmt.setNull(3,java.sql.Types.VARCHAR); else pstmt.setString(3,tempString); } // For column PROGRAM_ID { String tempString; tempString=(String)inputRecord.get(2); if(tempString==null) pstmt.setNull(4,java.sql.Types.VARCHAR); else pstmt.setString(4,tempString); } // For column PRIV_ID { String tempString; tempString=(String)inputRecord.get(3); if(tempString==null) pstmt.setNull(5,java.sql.Types.VARCHAR); else pstmt.setString(5,tempString); } // For column ACTIVE { String tempString; tempString=(String)inputRecord.get(4); if(tempString==null) pstmt.setNull(1,java.sql.Types.VARCHAR); else pstmt.setString(1,tempString); } if (pstmt.executeUpdate()==0) throw new DataStoreAdapterException("DSA_ERROR",new javax.ejb.NoSuchEntityException(), this.getClass()); } catch (SQLException e) { throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass()); } finally { try { if(pstmt != null) { returnPreparedStatement(connection, pstmt); } } catch (SQLException ignored) {} } } /** * StoreUsingOCC */ public void StoreUsingOCC(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException { PreparedStatement pstmt = null; try { pstmt = prepareStatement(connection,"UPDATE WKEXS.ROLE_DTL SET ACTIVE = ? WHERE COMPANY_ID = ? AND ROLE_ID = ? AND PROGRAM_ID = ? AND PRIV_ID = ?"); // For column COMPANY_ID { String tempString; tempString=(String)inputRecord.get(0); if(tempString==null) pstmt.setNull(2,java.sql.Types.VARCHAR); else pstmt.setString(2,tempString); } // For column ROLE_ID { String tempString; tempString=(String)inputRecord.get(1); if(tempString==null) pstmt.setNull(3,java.sql.Types.VARCHAR); else pstmt.setString(3,tempString); } // For column PROGRAM_ID { String tempString; tempString=(String)inputRecord.get(2); if(tempString==null) pstmt.setNull(4,java.sql.Types.VARCHAR); else pstmt.setString(4,tempString); } // For column PRIV_ID { String tempString; tempString=(String)inputRecord.get(3); if(tempString==null) pstmt.setNull(5,java.sql.Types.VARCHAR); else pstmt.setString(5,tempString); } // For column ACTIVE { String tempString; tempString=(String)inputRecord.get(4); if(tempString==null) pstmt.setNull(1,java.sql.Types.VARCHAR); else pstmt.setString(1,tempString); } IndexedRecord oldRecord = interactionSpec.getOldRecord(); if (pstmt.executeUpdate()==0) throw new DataStoreAdapterException("DSA_ERROR",new javax.ejb.NoSuchEntityException(), this.getClass()); } catch (SQLException e) { throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass()); } finally { try { if(pstmt != null) { returnPreparedStatement(connection, pstmt); } } catch (SQLException ignored) {} } } /** * FindByPrimaryKey */ public javax.resource.cci.Record FindByPrimaryKey(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException { PreparedStatement pstmt = null; ResultSet result=null; try { pstmt = prepareStatement(connection,"SELECT T1.COMPANY_ID, T1.ROLE_ID, T1.PROGRAM_ID, T1.PRIV_ID, T1.ACTIVE FROM WKEXS.ROLE_DTL T1 WHERE T1.COMPANY_ID = ? AND T1.ROLE_ID = ? AND T1.PROGRAM_ID = ? AND T1.PRIV_ID = ?"); // For column COMPANY_ID { String tempString; tempString=(String)inputRecord.get(0); if(tempString==null) pstmt.setNull(1,java.sql.Types.VARCHAR); else pstmt.setString(1,tempString); } // For column ROLE_ID { String tempString; tempString=(String)inputRecord.get(1); if(tempString==null) pstmt.setNull(2,java.sql.Types.VARCHAR); else pstmt.setString(2,tempString); } // For column PROGRAM_ID { String tempString; tempString=(String)inputRecord.get(2); if(tempString==null) pstmt.setNull(3,java.sql.Types.VARCHAR); else pstmt.setString(3,tempString); } // For column PRIV_ID { String tempString; tempString=(String)inputRecord.get(3); if(tempString==null) pstmt.setNull(4,java.sql.Types.VARCHAR); else pstmt.setString(4,tempString); } result = pstmt.executeQuery(); } catch (SQLException e) { throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass()); } return createCCIRecord(connection, result); } /** * FindByPrimaryKeyForUpdate */ public javax.resource.cci.Record FindByPrimaryKeyForUpdate(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException { PreparedStatement pstmt = null; ResultSet result=null; try { pstmt = prepareStatement(connection,"SELECT T1.COMPANY_ID, T1.ROLE_ID, T1.PROGRAM_ID, T1.PRIV_ID, T1.ACTIVE FROM WKEXS.ROLE_DTL T1 WHERE T1.COMPANY_ID = ? AND T1.ROLE_ID = ? AND T1.PROGRAM_ID = ? AND T1.PRIV_ID = ? FOR UPDATE "); // For column COMPANY_ID { String tempString; tempString=(String)inputRecord.get(0); if(tempString==null) pstmt.setNull(1,java.sql.Types.VARCHAR); else pstmt.setString(1,tempString); } // For column ROLE_ID { String tempString; tempString=(String)inputRecord.get(1); if(tempString==null) pstmt.setNull(2,java.sql.Types.VARCHAR); else pstmt.setString(2,tempString); } // For column PROGRAM_ID { String tempString; tempString=(String)inputRecord.get(2); if(tempString==null) pstmt.setNull(3,java.sql.Types.VARCHAR); else pstmt.setString(3,tempString); } // For column PRIV_ID { String tempString; tempString=(String)inputRecord.get(3); if(tempString==null) pstmt.setNull(4,java.sql.Types.VARCHAR); else pstmt.setString(4,tempString); } result = pstmt.executeQuery(); } catch (SQLException e) { throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass()); } return createCCIRecord(connection, result); } /** * FindByRoleId */ public javax.resource.cci.Record FindByRoleId(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException { PreparedStatement pstmt = null; ResultSet result=null; try { /* select object(o) from Role_Dtl o where o.company_id = ?1 and o.role_id = ?2 */ pstmt = prepareStatement(connection,"select q1.\"COMPANY_ID\", q1.\"ROLE_ID\", q1.\"PROGRAM_ID\", q1.\"PRIV_ID\", q1.\"ACTIVE\" from WKEXS.ROLE_DTL q1 where ( q1.\"COMPANY_ID\" = ?) and ( q1.\"ROLE_ID\" = ?)"); // For ?1 (company_id) { String tempString; tempString=(String)inputRecord.get(0); if(tempString==null) pstmt.setNull(1,java.sql.Types.VARCHAR); else pstmt.setString(1,tempString); } // For ?2 (role_id) { String tempString; tempString=(String)inputRecord.get(1); if(tempString==null) pstmt.setNull(2,java.sql.Types.VARCHAR); else pstmt.setString(2,tempString); } result = pstmt.executeQuery(); } catch (SQLException e) { throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass()); } return createCCIRecord(connection, result); } /** * FindByRoleIdForUpdate */ public javax.resource.cci.Record FindByRoleIdForUpdate(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException { PreparedStatement pstmt = null; ResultSet result=null; try { /* select object(o) from Role_Dtl o where o.company_id = ?1 and o.role_id = ?2 */ pstmt = prepareStatement(connection,"select q1.\"COMPANY_ID\", q1.\"ROLE_ID\", q1.\"PROGRAM_ID\", q1.\"PRIV_ID\", q1.\"ACTIVE\" from WKEXS.ROLE_DTL q1 where ( q1.\"COMPANY_ID\" = ?) and ( q1.\"ROLE_ID\" = ?) for update"); // For ?1 (company_id) { String tempString; tempString=(String)inputRecord.get(0); if(tempString==null) pstmt.setNull(1,java.sql.Types.VARCHAR); else pstmt.setString(1,tempString); } // For ?2 (role_id) { String tempString; tempString=(String)inputRecord.get(1); if(tempString==null) pstmt.setNull(2,java.sql.Types.VARCHAR); else pstmt.setString(2,tempString); } result = pstmt.executeQuery(); } catch (SQLException e) { throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass()); } return createCCIRecord(connection, result); } /** * Role_DtlBeanFunctionSet_f0aaab38 */ public Role_DtlBeanFunctionSet_f0aaab38() { functionHash=new java.util.HashMap(8); functionHash.put("Create",new Integer(0)); functionHash.put("Remove",new Integer(1)); functionHash.put("Store",new Integer(2)); functionHash.put("StoreUsingOCC",new Integer(3)); functionHash.put("FindByPrimaryKey",new Integer(4)); functionHash.put("FindByPrimaryKeyForUpdate",new Integer(5)); functionHash.put("FindByRoleId",new Integer(6)); functionHash.put("FindByRoleIdForUpdate",new Integer(7)); } /** * execute */ public Record execute(WSInteractionSpec interactionSpec, IndexedRecord inputRecord, Object connection) throws javax.resource.ResourceException { String functionName=interactionSpec.getFunctionName(); Record outputRecord=null; int functionIndex=((Integer)functionHash.get(functionName)).intValue(); switch (functionIndex) { case 0: Create(inputRecord,connection,interactionSpec); break; case 1: Remove(inputRecord,connection,interactionSpec); break; case 2: Store(inputRecord,connection,interactionSpec); break; case 3: StoreUsingOCC(inputRecord,connection,interactionSpec); break; case 4: outputRecord=FindByPrimaryKey(inputRecord,connection,interactionSpec); break; case 5: outputRecord=FindByPrimaryKeyForUpdate(inputRecord,connection,interactionSpec); break; case 6: outputRecord=FindByRoleId(inputRecord,connection,interactionSpec); break; case 7: outputRecord=FindByRoleIdForUpdate(inputRecord,connection,interactionSpec); break; } return outputRecord; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -