public void deleteAuditActionByUDescrIdx( CFSecurityAuthorization Authorization, String Description) { final String S_ProcName = "deleteAuditActionByUDescrIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_delete_auditaction_by_udescridx ?, ?, ?, ?, ?" + ", " + "?"; if (stmtDeleteByUDescrIdx == null) { stmtDeleteByUDescrIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByUDescrIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByUDescrIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByUDescrIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByUDescrIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByUDescrIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByUDescrIdx.setString(argIdx++, Description); Object stuff = null; boolean moreResults = stmtDeleteByUDescrIdx.execute(); while (stuff == null) { try { moreResults = stmtDeleteByUDescrIdx.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { stuff = stmtDeleteByUDescrIdx.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtDeleteByUDescrIdx.getUpdateCount()) { break; } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFSecurityISOCurrencyBuff lockBuff( CFSecurityAuthorization Authorization, CFSecurityISOCurrencyPKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); short Id = PKey.getRequiredId(); String sql = "exec sp_lock_iso_ccy ?, ?, ?, ?, ?" + ", " + "?"; if (stmtLockBuffByPKey == null) { stmtLockBuffByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtLockBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtLockBuffByPKey.setShort(argIdx++, Id); resultSet = stmtLockBuffByPKey.executeQuery(); if (resultSet.next()) { CFSecurityISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFSecurityISOCurrencyBuff[] readAllBuff(CFSecurityAuthorization Authorization) { final String S_ProcName = "readAllBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_read_iso_ccy_all ?, ?, ?, ?, ?"; if (stmtReadAllBuff == null) { stmtReadAllBuff = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadAllBuff.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadAllBuff.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); resultSet = stmtReadAllBuff.executeQuery(); List<CFSecurityISOCurrencyBuff> buffList = new LinkedList<CFSecurityISOCurrencyBuff>(); while (resultSet.next()) { CFSecurityISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFSecurityISOCurrencyBuff[] retBuff = new CFSecurityISOCurrencyBuff[buffList.size()]; Iterator<CFSecurityISOCurrencyBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFSecurityISOCurrencyBuff[] readAllDerived(CFSecurityAuthorization Authorization) { final String S_ProcName = "readAllDerived"; CFSecurityISOCurrencyBuff[] buffArray; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buffArray = readAllBuff(Authorization); return (buffArray); }
public CFSecurityISOCurrencyBuff readDerivedByCcyNmIdx( CFSecurityAuthorization Authorization, String Name) { final String S_ProcName = "CFCrmSybaseISOCurrencyTable.readDerivedByCcyNmIdx() "; CFSecurityISOCurrencyBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buff = readBuffByCcyNmIdx(Authorization, Name); return (buff); }
public CFSecurityISOCurrencyBuff lockDerived( CFSecurityAuthorization Authorization, CFSecurityISOCurrencyPKey PKey) { final String S_ProcName = "lockDerived"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFSecurityISOCurrencyBuff buff; buff = lockBuff(Authorization, PKey); return (buff); }
public String getSqlSelectISOCurrencyDistinctClassCode() { if (S_sqlSelectISOCurrencyDistinctClassCode == null) { S_sqlSelectISOCurrencyDistinctClassCode = "SELECT " + "DISTINCT iscy.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + "..iso_ccy AS iscy "; } return (S_sqlSelectISOCurrencyDistinctClassCode); }
public CFSecurityAuditActionBuff readDerivedByUDescrIdx( CFSecurityAuthorization Authorization, String Description) { final String S_ProcName = "CFCrmSybaseAuditActionTable.readDerivedByUDescrIdx() "; CFSecurityAuditActionBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buff = readBuffByUDescrIdx(Authorization, Description); return (buff); }
public String getSqlSelectAuditActionDistinctClassCode() { if (S_sqlSelectAuditActionDistinctClassCode == null) { S_sqlSelectAuditActionDistinctClassCode = "SELECT " + "DISTINCT audt.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + "..AuditAction AS audt "; } return (S_sqlSelectAuditActionDistinctClassCode); }
protected CFSecurityAuditActionBuff unpackAuditActionResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAuditActionResultSetToBuff"; int idxcol = 1; CFSecurityAuditActionBuff buff = schema.getFactoryAuditAction().newBuff(); buff.setRequiredAuditActionId(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
public String getSqlSelectAuditActionBuff() { if (S_sqlSelectAuditActionBuff == null) { S_sqlSelectAuditActionBuff = "SELECT " + "audt.auditactionid, " + "audt.description, " + "audt.revision " + "FROM " + schema.getLowerDbSchemaName() + "..AuditAction AS audt "; } return (S_sqlSelectAuditActionBuff); }
public CFSecurityISOCurrencyBuff readBuffByCcyNmIdx( CFSecurityAuthorization Authorization, String Name) { final String S_ProcName = "readBuffByCcyNmIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_read_iso_ccy_by_ccynmidx ?, ?, ?, ?, ?" + ", " + "?"; if (stmtReadBuffByCcyNmIdx == null) { stmtReadBuffByCcyNmIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByCcyNmIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyNmIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCcyNmIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCcyNmIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyNmIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByCcyNmIdx.setString(argIdx++, Name); resultSet = stmtReadBuffByCcyNmIdx.executeQuery(); if (resultSet.next()) { CFSecurityISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public String getSqlSelectISOCurrencyBuff() { if (S_sqlSelectISOCurrencyBuff == null) { S_sqlSelectISOCurrencyBuff = "SELECT " + "iscy.id, " + "iscy.iso_code, " + "iscy.ccy_name, " + "iscy.unit_symbol, " + "iscy.frac_symbol, " + "iscy.precis, " + "iscy.revision " + "FROM " + schema.getLowerDbSchemaName() + "..iso_ccy AS iscy "; } return (S_sqlSelectISOCurrencyBuff); }
public void deleteISOCurrency( CFSecurityAuthorization Authorization, CFSecurityISOCurrencyBuff Buff) { final String S_ProcName = "deleteISOCurrency"; try { Connection cnx = schema.getCnx(); short Id = Buff.getRequiredId(); String sql = "exec sp_delete_iso_ccy ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?"; if (stmtDeleteByPKey == null) { stmtDeleteByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByPKey.setShort(argIdx++, Id); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; Object stuff = null; boolean moreResults = stmtDeleteByPKey.execute(); while (stuff == null) { try { moreResults = stmtDeleteByPKey.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { stuff = stmtDeleteByPKey.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtDeleteByPKey.getUpdateCount()) { break; } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } }
public void updateISOCurrency( CFSecurityAuthorization Authorization, CFSecurityISOCurrencyBuff Buff) { final String S_ProcName = "updateISOCurrency"; ResultSet resultSet = null; try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); String UnitSymbol = Buff.getOptionalUnitSymbol(); String FracSymbol = Buff.getOptionalFracSymbol(); short Precis = Buff.getRequiredPrecis(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); String sql = "exec sp_update_iso_ccy ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"; if (stmtUpdateByPKey == null) { stmtUpdateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtUpdateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtUpdateByPKey.setString(argIdx++, "ISCY"); stmtUpdateByPKey.setShort(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, Name); if (UnitSymbol != null) { stmtUpdateByPKey.setString(argIdx++, UnitSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } if (FracSymbol != null) { stmtUpdateByPKey.setString(argIdx++, FracSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } stmtUpdateByPKey.setShort(argIdx++, Precis); stmtUpdateByPKey.setInt(argIdx++, Revision); resultSet = stmtUpdateByPKey.executeQuery(); if (resultSet.next()) { CFSecurityISOCurrencyBuff updatedBuff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredISOCode(updatedBuff.getRequiredISOCode()); Buff.setRequiredName(updatedBuff.getRequiredName()); Buff.setOptionalUnitSymbol(updatedBuff.getOptionalUnitSymbol()); Buff.setOptionalFracSymbol(updatedBuff.getOptionalFracSymbol()); Buff.setRequiredPrecis(updatedBuff.getRequiredPrecis()); Buff.setRequiredRevision(updatedBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
protected CFSecurityISOCurrencyBuff unpackISOCurrencyResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackISOCurrencyResultSetToBuff"; int idxcol = 1; CFSecurityISOCurrencyBuff buff = schema.getFactoryISOCurrency().newBuff(); { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFCrmSybaseSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFCrmSybaseSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredId(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredISOCode(resultSet.getString(idxcol)); idxcol++; buff.setRequiredName(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalUnitSymbol(null); } else { buff.setOptionalUnitSymbol(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalFracSymbol(null); } else { buff.setOptionalFracSymbol(colVal); } } idxcol++; buff.setRequiredPrecis(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
public void createAuditAction( CFSecurityAuthorization Authorization, CFSecurityAuditActionBuff Buff) { final String S_ProcName = "createAuditAction"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { short AuditActionId = Buff.getRequiredAuditActionId(); String Description = Buff.getRequiredDescription(); Connection cnx = schema.getCnx(); String sql = "exec sp_create_auditaction ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, "AUDT"); stmtCreateByPKey.setShort(argIdx++, AuditActionId); stmtCreateByPKey.setString(argIdx++, Description); resultSet = stmtCreateByPKey.executeQuery(); if (resultSet.next()) { CFSecurityAuditActionBuff createdBuff = unpackAuditActionResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredAuditActionId(createdBuff.getRequiredAuditActionId()); Buff.setRequiredDescription(createdBuff.getRequiredDescription()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }