public CFSecurityISOLanguageBuff readDerivedByCode3Idx(
      CFSecurityAuthorization Authorization, String ISO6392Code) {
    final String S_ProcName = "CFInternetRamISOLanguage.readDerivedByCode3Idx";
    CFSecurityISOLanguageByCode3IdxKey key = schema.getFactoryISOLanguage().newCode3IdxKey();
    key.setRequiredISO6392Code(ISO6392Code);

    CFSecurityISOLanguageBuff buff;
    if (dictByCode3Idx.containsKey(key)) {
      buff = dictByCode3Idx.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 deleteISOLanguage(
      CFSecurityAuthorization Authorization, CFSecurityISOLanguageBuff Buff) {
    final String S_ProcName = "CFInternetRamISOLanguageTable.deleteISOLanguage() ";
    CFSecurityISOLanguagePKey pkey = schema.getFactoryISOLanguage().newPKey();
    pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());
    CFSecurityISOLanguageBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteISOLanguage", pkey);
    }
    CFSecurityISOLanguageByCode3IdxKey keyCode3Idx =
        schema.getFactoryISOLanguage().newCode3IdxKey();
    keyCode3Idx.setRequiredISO6392Code(existing.getRequiredISO6392Code());

    CFSecurityISOLanguageByCode2IdxKey keyCode2Idx =
        schema.getFactoryISOLanguage().newCode2IdxKey();
    keyCode2Idx.setOptionalISO6391Code(existing.getOptionalISO6391Code());

    // Validate reverse foreign keys

    // Delete is valid

    schema
        .getTableISOCountryLanguage()
        .deleteISOCountryLanguageByLanguageIdx(Authorization, Buff.getRequiredISOLanguageId());
    Map<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff> subdict;

    dictByPKey.remove(pkey);

    dictByCode3Idx.remove(keyCode3Idx);

    subdict = dictByCode2Idx.get(keyCode2Idx);
    subdict.remove(pkey);
  }
 public void deleteISOLanguageByCode3Idx(
     CFSecurityAuthorization Authorization, CFSecurityISOLanguageByCode3IdxKey argKey) {
   CFSecurityISOLanguageBuff cur;
   LinkedList<CFSecurityISOLanguageBuff> matchSet = new LinkedList<CFSecurityISOLanguageBuff>();
   Iterator<CFSecurityISOLanguageBuff> values = dictByPKey.values().iterator();
   while (values.hasNext()) {
     cur = values.next();
     if (argKey.equals(cur)) {
       matchSet.add(cur);
     }
   }
   Iterator<CFSecurityISOLanguageBuff> iterMatch = matchSet.iterator();
   while (iterMatch.hasNext()) {
     cur = iterMatch.next();
     deleteISOLanguage(Authorization, cur);
   }
 }
 public void deleteISOLanguageByCode3Idx(
     CFSecurityAuthorization Authorization, String argISO6392Code) {
   CFSecurityISOLanguageByCode3IdxKey key = schema.getFactoryISOLanguage().newCode3IdxKey();
   key.setRequiredISO6392Code(argISO6392Code);
   deleteISOLanguageByCode3Idx(Authorization, key);
 }
  public void updateISOLanguage(
      CFSecurityAuthorization Authorization, CFSecurityISOLanguageBuff Buff) {
    CFSecurityISOLanguagePKey pkey = schema.getFactoryISOLanguage().newPKey();
    pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());
    CFSecurityISOLanguageBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newStaleCacheDetectedException(
              getClass(), "updateISOLanguage", "Existing record not found", "ISOLanguage", pkey);
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "updateISOLanguage", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFSecurityISOLanguageByCode3IdxKey existingKeyCode3Idx =
        schema.getFactoryISOLanguage().newCode3IdxKey();
    existingKeyCode3Idx.setRequiredISO6392Code(existing.getRequiredISO6392Code());

    CFSecurityISOLanguageByCode3IdxKey newKeyCode3Idx =
        schema.getFactoryISOLanguage().newCode3IdxKey();
    newKeyCode3Idx.setRequiredISO6392Code(Buff.getRequiredISO6392Code());

    CFSecurityISOLanguageByCode2IdxKey existingKeyCode2Idx =
        schema.getFactoryISOLanguage().newCode2IdxKey();
    existingKeyCode2Idx.setOptionalISO6391Code(existing.getOptionalISO6391Code());

    CFSecurityISOLanguageByCode2IdxKey newKeyCode2Idx =
        schema.getFactoryISOLanguage().newCode2IdxKey();
    newKeyCode2Idx.setOptionalISO6391Code(Buff.getOptionalISO6391Code());

    // Check unique indexes

    if (!existingKeyCode3Idx.equals(newKeyCode3Idx)) {
      if (dictByCode3Idx.containsKey(newKeyCode3Idx)) {
        throw CFLib.getDefaultExceptionFactory()
            .newUniqueIndexViolationException(
                getClass(), "updateISOLanguage", "ISOLanguage6392Idx", newKeyCode3Idx);
      }
    }

    // Validate foreign keys

    // Update is valid

    Map<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    dictByCode3Idx.remove(existingKeyCode3Idx);
    dictByCode3Idx.put(newKeyCode3Idx, Buff);

    subdict = dictByCode2Idx.get(existingKeyCode2Idx);
    if (subdict != null) {
      subdict.remove(pkey);
    }
    if (dictByCode2Idx.containsKey(newKeyCode2Idx)) {
      subdict = dictByCode2Idx.get(newKeyCode2Idx);
    } else {
      subdict = new HashMap<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff>();
      dictByCode2Idx.put(newKeyCode2Idx, subdict);
    }
    subdict.put(pkey, Buff);
  }
 public void deleteISOLanguageByCode3Idx(
     CFSecurityAuthorization Authorization, CFSecurityISOLanguageByCode3IdxKey argKey) {
   deleteISOLanguageByCode3Idx(Authorization, argKey.getRequiredISO6392Code());
 }