protected CFSecuritySysClusterBuff unpackSysClusterResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackSysClusterResultSetToBuff"; int idxcol = 1; CFSecuritySysClusterBuff buff = schema.getFactorySysCluster().newBuff(); buff.setRequiredSingletonId(resultSet.getInt(idxcol)); idxcol++; buff.setRequiredClusterId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
public void deleteSysCluster( CFSecurityAuthorization Authorization, CFSecuritySysClusterBuff Buff) { final String S_ProcName = "deleteSysCluster"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); int SingletonId = Buff.getRequiredSingletonId(); final String sql = "CALL sp_delete_sysclus( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; 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.setInt(argIdx++, SingletonId); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; resultSet = stmtDeleteByPKey.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public void deleteISOLanguageByCode2Idx( CFSecurityAuthorization Authorization, String argISO6391Code) { final String S_ProcName = "deleteISOLanguageByCode2Idx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_delete_iso_lang_by_code2idx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtDeleteByCode2Idx == null) { stmtDeleteByCode2Idx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByCode2Idx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCode2Idx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByCode2Idx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByCode2Idx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCode2Idx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argISO6391Code != null) { stmtDeleteByCode2Idx.setString(argIdx++, argISO6391Code); } else { stmtDeleteByCode2Idx.setNull(argIdx++, java.sql.Types.VARCHAR); } resultSet = stmtDeleteByCode2Idx.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
protected CFSecurityTenantBuff unpackTenantResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackTenantResultSetToBuff"; int idxcol = 1; CFSecurityTenantBuff buff = schema.getFactoryTenant().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(CFAsteriskSybaseSchema.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(CFAsteriskSybaseSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredClusterId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredTenantName(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
protected CFSecurityISOLanguageBuff unpackISOLanguageResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackISOLanguageResultSetToBuff"; int idxcol = 1; CFSecurityISOLanguageBuff buff = schema.getFactoryISOLanguage().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(CFAsteriskDb2LUWSchema.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(CFAsteriskDb2LUWSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredISOLanguageId(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredISO6392Code(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalISO6391Code(null); } else { buff.setOptionalISO6391Code(colVal); } } idxcol++; buff.setRequiredEnglishName(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }