public CFSecurityISOLanguageBuff lockBuff( CFSecurityAuthorization Authorization, CFSecurityISOLanguagePKey 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 ISOLanguageId = PKey.getRequiredISOLanguageId(); final String sql = "CALL sp_lock_iso_lang( ?, ?, ?, ?, ?" + ", " + "?" + " )"; 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++, ISOLanguageId); resultSet = stmtLockBuffByPKey.executeQuery(); if (resultSet.next()) { CFSecurityISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(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 CFSecurityISOLanguageBuff lockDerived( CFSecurityAuthorization Authorization, CFSecurityISOLanguagePKey PKey) { final String S_ProcName = "CFInternetRamISOLanguage.readDerived"; CFSecurityISOLanguagePKey key = schema.getFactoryISOLanguage().newPKey(); key.setRequiredISOLanguageId(PKey.getRequiredISOLanguageId()); CFSecurityISOLanguageBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); }
public void createISOLanguage( CFSecurityAuthorization Authorization, CFSecurityISOLanguageBuff Buff) { final String S_ProcName = "createISOLanguage"; CFSecurityISOLanguagePKey pkey = schema.getFactoryISOLanguage().newPKey(); pkey.setRequiredISOLanguageId(schema.nextISOLanguageIdGen()); Buff.setRequiredISOLanguageId(pkey.getRequiredISOLanguageId()); CFSecurityISOLanguageByCode3IdxKey keyCode3Idx = schema.getFactoryISOLanguage().newCode3IdxKey(); keyCode3Idx.setRequiredISO6392Code(Buff.getRequiredISO6392Code()); CFSecurityISOLanguageByCode2IdxKey keyCode2Idx = schema.getFactoryISOLanguage().newCode2IdxKey(); keyCode2Idx.setOptionalISO6391Code(Buff.getOptionalISO6391Code()); // Validate unique indexes if (dictByPKey.containsKey(pkey)) { throw CFLib.getDefaultExceptionFactory() .newPrimaryKeyNotNewException(getClass(), S_ProcName, pkey); } if (dictByCode3Idx.containsKey(keyCode3Idx)) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, "ISOLanguage6392Idx", keyCode3Idx); } // Validate foreign keys // Proceed with adding the new record dictByPKey.put(pkey, Buff); dictByCode3Idx.put(keyCode3Idx, Buff); Map<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff> subdictCode2Idx; if (dictByCode2Idx.containsKey(keyCode2Idx)) { subdictCode2Idx = dictByCode2Idx.get(keyCode2Idx); } else { subdictCode2Idx = new HashMap<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff>(); dictByCode2Idx.put(keyCode2Idx, subdictCode2Idx); } subdictCode2Idx.put(pkey, Buff); }
public void deleteISOLanguageByIdIdx( CFSecurityAuthorization Authorization, CFSecurityISOLanguagePKey argKey) { deleteISOLanguageByIdIdx(Authorization, argKey.getRequiredISOLanguageId()); }