public ICFSecurityISOCountryCurrencyObj readISOCountryCurrency(
     CFSecurityISOCountryCurrencyPKey pkey, boolean forceRead) {
   ICFSecurityISOCountryCurrencyObj obj = null;
   if ((!forceRead) && members.containsKey(pkey)) {
     obj = members.get(pkey);
   } else {
     CFSecurityISOCountryCurrencyBuff readBuff =
         ((ICFInternetSchema) schema.getBackingStore())
             .getTableISOCountryCurrency()
             .readDerivedByIdIdx(
                 schema.getAuthorization(),
                 pkey.getRequiredISOCountryId(),
                 pkey.getRequiredISOCurrencyId());
     if (readBuff != null) {
       obj = schema.getISOCountryCurrencyTableObj().newInstance();
       obj.setPKey(
           ((ICFInternetSchema) schema.getBackingStore())
               .getFactoryISOCountryCurrency()
               .newPKey());
       obj.setBuff(readBuff);
       obj = (ICFSecurityISOCountryCurrencyObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       members.put(pkey, null);
     }
   }
   return (obj);
 }
 public ICFCrmMemoObj readMemoByUDescrIdx(
     long TenantId, long ContactId, String Description, boolean forceRead) {
   if (indexByUDescrIdx == null) {
     indexByUDescrIdx = new HashMap<CFCrmMemoByUDescrIdxKey, ICFCrmMemoObj>();
   }
   CFCrmMemoByUDescrIdxKey key =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newUDescrIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredContactId(ContactId);
   key.setRequiredDescription(Description);
   ICFCrmMemoObj obj = null;
   if ((!forceRead) && indexByUDescrIdx.containsKey(key)) {
     obj = indexByUDescrIdx.get(key);
   } else {
     CFCrmMemoBuff buff =
         ((ICFAccSchema) schema.getBackingStore())
             .getTableMemo()
             .readDerivedByUDescrIdx(schema.getAuthorization(), TenantId, ContactId, Description);
     if (buff != null) {
       obj = schema.getMemoTableObj().newInstance();
       obj.setPKey(((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newPKey());
       obj.setBuff(buff);
       obj = (ICFCrmMemoObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       indexByUDescrIdx.put(key, null);
     }
   }
   return (obj);
 }
 public ICFSecurityTSecGroupMemberObj readTSecGroupMemberByUUserIdx(
     long TenantId, int TSecGroupId, UUID SecUserId, boolean forceRead) {
   if (indexByUUserIdx == null) {
     indexByUUserIdx =
         new HashMap<CFSecurityTSecGroupMemberByUUserIdxKey, ICFSecurityTSecGroupMemberObj>();
   }
   CFSecurityTSecGroupMemberByUUserIdxKey key =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newUUserIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredTSecGroupId(TSecGroupId);
   key.setRequiredSecUserId(SecUserId);
   ICFSecurityTSecGroupMemberObj obj = null;
   if ((!forceRead) && indexByUUserIdx.containsKey(key)) {
     obj = indexByUUserIdx.get(key);
   } else {
     CFSecurityTSecGroupMemberBuff buff =
         ((ICFBamSchema) schema.getBackingStore())
             .getTableTSecGroupMember()
             .readDerivedByUUserIdx(schema.getAuthorization(), TenantId, TSecGroupId, SecUserId);
     if (buff != null) {
       obj = schema.getTSecGroupMemberTableObj().newInstance();
       obj.setPKey(
           ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newPKey());
       obj.setBuff(buff);
       obj = (ICFSecurityTSecGroupMemberObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       indexByUUserIdx.put(key, null);
     }
   }
   return (obj);
 }
 public ICFSecurityTSecGroupMemberObj readTSecGroupMember(
     CFSecurityTSecGroupMemberPKey pkey, boolean forceRead) {
   ICFSecurityTSecGroupMemberObj obj = null;
   if ((!forceRead) && members.containsKey(pkey)) {
     obj = members.get(pkey);
   } else {
     CFSecurityTSecGroupMemberBuff readBuff =
         ((ICFBamSchema) schema.getBackingStore())
             .getTableTSecGroupMember()
             .readDerivedByIdIdx(
                 schema.getAuthorization(),
                 pkey.getRequiredTenantId(),
                 pkey.getRequiredTSecGroupMemberId());
     if (readBuff != null) {
       obj = schema.getTSecGroupMemberTableObj().newInstance();
       obj.setPKey(
           ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newPKey());
       obj.setBuff(readBuff);
       obj = (ICFSecurityTSecGroupMemberObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       members.put(pkey, null);
     }
   }
   return (obj);
 }
  public void deleteISOCurrency(CFBamAuthorization Authorization, CFBamISOCurrencyBuff Buff) {
    final String S_ProcName = "CFBamRamISOCurrencyTable.deleteISOCurrency() ";
    CFBamISOCurrencyPKey pkey = schema.getFactoryISOCurrency().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    CFBamISOCurrencyBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteISOCurrency", pkey);
    }
    CFBamISOCurrencyByCcyCdIdxKey keyCcyCdIdx = schema.getFactoryISOCurrency().newCcyCdIdxKey();
    keyCcyCdIdx.setRequiredISOCode(existing.getRequiredISOCode());

    CFBamISOCurrencyByCcyNmIdxKey keyCcyNmIdx = schema.getFactoryISOCurrency().newCcyNmIdxKey();
    keyCcyNmIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema
        .getTableISOCountryCurrency()
        .deleteISOCountryCurrencyByCurrencyIdx(Authorization, Buff.getRequiredId());
    Map<CFBamISOCurrencyPKey, CFBamISOCurrencyBuff> subdict;

    dictByPKey.remove(pkey);

    dictByCcyCdIdx.remove(keyCcyCdIdx);

    dictByCcyNmIdx.remove(keyCcyNmIdx);
  }
 public ICFBamClearTopDepObj readClearTopDepByUNameIdx(
     long TenantId, long ContTableId, String Name, boolean forceRead) {
   if (indexByUNameIdx == null) {
     indexByUNameIdx = new HashMap<CFBamClearTopDepByUNameIdxKey, ICFBamClearTopDepObj>();
   }
   CFBamClearTopDepByUNameIdxKey key =
       schema.getBackingStore().getFactoryClearTopDep().newUNameIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredContTableId(ContTableId);
   key.setRequiredName(Name);
   ICFBamClearTopDepObj obj = null;
   if ((!forceRead) && indexByUNameIdx.containsKey(key)) {
     obj = indexByUNameIdx.get(key);
   } else {
     CFBamClearTopDepBuff buff =
         schema
             .getBackingStore()
             .getTableClearTopDep()
             .readDerivedByUNameIdx(schema.getAuthorization(), TenantId, ContTableId, Name);
     if (buff != null) {
       obj =
           (ICFBamClearTopDepObj)
               schema.getScopeTableObj().constructByClassCode(buff.getClassCode());
       obj.setPKey(schema.getBackingStore().getFactoryScope().newPKey());
       obj.setBuff(buff);
       obj = (ICFBamClearTopDepObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       indexByUNameIdx.put(key, null);
     }
   }
   return (obj);
 }
 public void deleteTSecGroupMemberByUUserIdx(long TenantId, int TSecGroupId, UUID SecUserId) {
   if (indexByUUserIdx == null) {
     indexByUUserIdx =
         new HashMap<CFSecurityTSecGroupMemberByUUserIdxKey, ICFSecurityTSecGroupMemberObj>();
   }
   CFSecurityTSecGroupMemberByUUserIdxKey key =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newUUserIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredTSecGroupId(TSecGroupId);
   key.setRequiredSecUserId(SecUserId);
   ICFSecurityTSecGroupMemberObj obj = null;
   if (indexByUUserIdx.containsKey(key)) {
     obj = indexByUUserIdx.get(key);
     ((ICFBamSchema) schema.getBackingStore())
         .getTableTSecGroupMember()
         .deleteTSecGroupMemberByUUserIdx(
             schema.getAuthorization(), TenantId, TSecGroupId, SecUserId);
     obj.forget(true);
   } else {
     ((ICFBamSchema) schema.getBackingStore())
         .getTableTSecGroupMember()
         .deleteTSecGroupMemberByUUserIdx(
             schema.getAuthorization(), TenantId, TSecGroupId, SecUserId);
   }
 }
  public void deleteSecGroupForm(
      CFSecurityAuthorization Authorization, CFSecuritySecGroupFormBuff Buff) {
    final String S_ProcName = "CFInternetRamSecGroupFormTable.deleteSecGroupForm() ";
    CFSecuritySecGroupFormPKey pkey = schema.getFactorySecGroupForm().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredSecGroupFormId(Buff.getRequiredSecGroupFormId());
    CFSecuritySecGroupFormBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteSecGroupForm", pkey);
    }
    CFSecuritySecGroupFormByClusterIdxKey keyClusterIdx =
        schema.getFactorySecGroupForm().newClusterIdxKey();
    keyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFSecuritySecGroupFormByGroupIdxKey keyGroupIdx =
        schema.getFactorySecGroupForm().newGroupIdxKey();
    keyGroupIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyGroupIdx.setRequiredSecGroupId(existing.getRequiredSecGroupId());

    CFSecuritySecGroupFormByAppIdxKey keyAppIdx = schema.getFactorySecGroupForm().newAppIdxKey();
    keyAppIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyAppIdx.setRequiredSecAppId(existing.getRequiredSecAppId());

    CFSecuritySecGroupFormByFormIdxKey keyFormIdx = schema.getFactorySecGroupForm().newFormIdxKey();
    keyFormIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyFormIdx.setRequiredSecFormId(existing.getRequiredSecFormId());

    CFSecuritySecGroupFormByUFormIdxKey keyUFormIdx =
        schema.getFactorySecGroupForm().newUFormIdxKey();
    keyUFormIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyUFormIdx.setRequiredSecGroupId(existing.getRequiredSecGroupId());
    keyUFormIdx.setRequiredSecFormId(existing.getRequiredSecFormId());

    // Validate reverse foreign keys

    // Delete is valid

    Map<CFSecuritySecGroupFormPKey, CFSecuritySecGroupFormBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByClusterIdx.get(keyClusterIdx);
    subdict.remove(pkey);

    subdict = dictByGroupIdx.get(keyGroupIdx);
    subdict.remove(pkey);

    subdict = dictByAppIdx.get(keyAppIdx);
    subdict.remove(pkey);

    subdict = dictByFormIdx.get(keyFormIdx);
    subdict.remove(pkey);

    dictByUFormIdx.remove(keyUFormIdx);
  }
  public void forgetTSecGroupMember(ICFSecurityTSecGroupMemberObj Obj, boolean forgetSubObjects) {
    ICFSecurityTSecGroupMemberObj obj = Obj;
    CFSecurityTSecGroupMemberPKey pkey = obj.getPKey();
    if (members.containsKey(pkey)) {
      ICFSecurityTSecGroupMemberObj keepObj = members.get(pkey);
      // Detach object from alternate, duplicate, all and PKey indexes

      if (indexByTenantIdx != null) {
        CFSecurityTSecGroupMemberByTenantIdxKey keyTenantIdx =
            ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newTenantIdxKey();
        keyTenantIdx.setRequiredTenantId(keepObj.getRequiredTenantId());
        Map<CFSecurityTSecGroupMemberPKey, ICFSecurityTSecGroupMemberObj> mapTenantIdx =
            indexByTenantIdx.get(keyTenantIdx);
        if (mapTenantIdx != null) {
          mapTenantIdx.remove(keepObj.getPKey());
        }
      }

      if (indexByGroupIdx != null) {
        CFSecurityTSecGroupMemberByGroupIdxKey keyGroupIdx =
            ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newGroupIdxKey();
        keyGroupIdx.setRequiredTenantId(keepObj.getRequiredTenantId());
        keyGroupIdx.setRequiredTSecGroupId(keepObj.getRequiredTSecGroupId());
        Map<CFSecurityTSecGroupMemberPKey, ICFSecurityTSecGroupMemberObj> mapGroupIdx =
            indexByGroupIdx.get(keyGroupIdx);
        if (mapGroupIdx != null) {
          mapGroupIdx.remove(keepObj.getPKey());
        }
      }

      if (indexByUserIdx != null) {
        CFSecurityTSecGroupMemberByUserIdxKey keyUserIdx =
            ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newUserIdxKey();
        keyUserIdx.setRequiredSecUserId(keepObj.getRequiredSecUserId());
        Map<CFSecurityTSecGroupMemberPKey, ICFSecurityTSecGroupMemberObj> mapUserIdx =
            indexByUserIdx.get(keyUserIdx);
        if (mapUserIdx != null) {
          mapUserIdx.remove(keepObj.getPKey());
        }
      }

      if (indexByUUserIdx != null) {
        CFSecurityTSecGroupMemberByUUserIdxKey keyUUserIdx =
            ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newUUserIdxKey();
        keyUUserIdx.setRequiredTenantId(keepObj.getRequiredTenantId());
        keyUUserIdx.setRequiredTSecGroupId(keepObj.getRequiredTSecGroupId());
        keyUUserIdx.setRequiredSecUserId(keepObj.getRequiredSecUserId());
        indexByUUserIdx.remove(keyUUserIdx);
      }

      if (allTSecGroupMember != null) {
        allTSecGroupMember.remove(keepObj.getPKey());
      }
      members.remove(pkey);
      if (forgetSubObjects) {}
    }
  }
  public void deleteTSecGroupMember(
      CFSecurityAuthorization Authorization, CFSecurityTSecGroupMemberBuff Buff) {
    final String S_ProcName = "CFSecurityRamTSecGroupMemberTable.deleteTSecGroupMember() ";
    CFSecurityTSecGroupMemberPKey pkey = schema.getFactoryTSecGroupMember().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupMemberId(Buff.getRequiredTSecGroupMemberId());
    CFSecurityTSecGroupMemberBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteTSecGroupMember", pkey);
    }
    CFSecurityTSecGroupMemberByTenantIdxKey keyTenantIdx =
        schema.getFactoryTSecGroupMember().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFSecurityTSecGroupMemberByGroupIdxKey keyGroupIdx =
        schema.getFactoryTSecGroupMember().newGroupIdxKey();
    keyGroupIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyGroupIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());

    CFSecurityTSecGroupMemberByUserIdxKey keyUserIdx =
        schema.getFactoryTSecGroupMember().newUserIdxKey();
    keyUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    CFSecurityTSecGroupMemberByUUserIdxKey keyUUserIdx =
        schema.getFactoryTSecGroupMember().newUUserIdxKey();
    keyUUserIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyUUserIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());
    keyUUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    // Validate reverse foreign keys

    // Delete is valid

    Map<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByTenantIdx.get(keyTenantIdx);
    subdict.remove(pkey);

    subdict = dictByGroupIdx.get(keyGroupIdx);
    subdict.remove(pkey);

    subdict = dictByUserIdx.get(keyUserIdx);
    subdict.remove(pkey);

    dictByUUserIdx.remove(keyUUserIdx);
  }
 public CFBamDelSubDep3Buff lockDerived(CFBamAuthorization Authorization, CFBamScopePKey PKey) {
   final String S_ProcName = "CFBamRamDelSubDep3.readDerived() ";
   CFBamScopePKey key = schema.getFactoryScope().newPKey();
   key.setRequiredTenantId(PKey.getRequiredTenantId());
   key.setRequiredId(PKey.getRequiredId());
   CFBamDelSubDep3Buff buff;
   if (dictByPKey.containsKey(key)) {
     buff = dictByPKey.get(key);
   } else {
     buff = null;
   }
   return (buff);
 }
  public CFBamISOCurrencyBuff readDerivedByIdIdx(CFBamAuthorization Authorization, short Id) {
    final String S_ProcName = "CFBamRamISOCurrency.readDerivedByIdIdx() ";
    CFBamISOCurrencyPKey key = schema.getFactoryISOCurrency().newPKey();
    key.setRequiredId(Id);

    CFBamISOCurrencyBuff buff;
    if (dictByPKey.containsKey(key)) {
      buff = dictByPKey.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
  public CFBamISOCurrencyBuff readDerivedByCcyNmIdx(CFBamAuthorization Authorization, String Name) {
    final String S_ProcName = "CFBamRamISOCurrency.readDerivedByCcyNmIdx() ";
    CFBamISOCurrencyByCcyNmIdxKey key = schema.getFactoryISOCurrency().newCcyNmIdxKey();
    key.setRequiredName(Name);

    CFBamISOCurrencyBuff buff;
    if (dictByCcyNmIdx.containsKey(key)) {
      buff = dictByCcyNmIdx.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
 public CFDbTestReqMinMaxValueBuff lockDerived(
     CFSecurityAuthorization Authorization, CFDbTestReqMinMaxValuePKey PKey) {
   final String S_ProcName = "CFDbTestRamReqMinMaxValue.readDerived";
   CFDbTestReqMinMaxValuePKey key = schema.getFactoryReqMinMaxValue().newPKey();
   key.setRequiredTenantId(PKey.getRequiredTenantId());
   key.setRequiredId(PKey.getRequiredId());
   CFDbTestReqMinMaxValueBuff buff;
   if (dictByPKey.containsKey(key)) {
     buff = dictByPKey.get(key);
   } else {
     buff = null;
   }
   return (buff);
 }
 public void forgetMemoByIdIdx(long TenantId, long MemoId) {
   if (members == null) {
     return;
   }
   CFCrmMemoPKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newPKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredMemoId(MemoId);
   if (members.containsKey(key)) {
     ICFCrmMemoObj probed = members.get(key);
     if (probed != null) {
       probed.forget(true);
     }
   }
 }
 public CFSecuritySecGroupFormBuff lockDerived(
     CFSecurityAuthorization Authorization, CFSecuritySecGroupFormPKey PKey) {
   final String S_ProcName = "CFInternetRamSecGroupForm.readDerived";
   CFSecuritySecGroupFormPKey key = schema.getFactorySecGroupForm().newPKey();
   key.setRequiredClusterId(PKey.getRequiredClusterId());
   key.setRequiredSecGroupFormId(PKey.getRequiredSecGroupFormId());
   CFSecuritySecGroupFormBuff buff;
   if (dictByPKey.containsKey(key)) {
     buff = dictByPKey.get(key);
   } else {
     buff = null;
   }
   return (buff);
 }
 public CFSecurityHostNodeBuff lockDerived(
     CFSecurityAuthorization Authorization, CFSecurityHostNodePKey PKey) {
   final String S_ProcName = "CFAccRamHostNode.readDerived";
   CFSecurityHostNodePKey key = schema.getFactoryHostNode().newPKey();
   key.setRequiredClusterId(PKey.getRequiredClusterId());
   key.setRequiredHostNodeId(PKey.getRequiredHostNodeId());
   CFSecurityHostNodeBuff buff;
   if (dictByPKey.containsKey(key)) {
     buff = dictByPKey.get(key);
   } else {
     buff = null;
   }
   return (buff);
 }
 public void forgetClearTopDepByIdIdx(long TenantId, long Id) {
   if (members == null) {
     return;
   }
   CFBamScopePKey key = schema.getBackingStore().getFactoryScope().newPKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredId(Id);
   if (members.containsKey(key)) {
     ICFBamClearTopDepObj probed = members.get(key);
     if (probed != null) {
       probed.forget(true);
     }
   }
 }
 public CFSecurityTSecGroupMemberBuff lockDerived(
     CFSecurityAuthorization Authorization, CFSecurityTSecGroupMemberPKey PKey) {
   final String S_ProcName = "CFSecurityRamTSecGroupMember.readDerived";
   CFSecurityTSecGroupMemberPKey key = schema.getFactoryTSecGroupMember().newPKey();
   key.setRequiredTenantId(PKey.getRequiredTenantId());
   key.setRequiredTSecGroupMemberId(PKey.getRequiredTSecGroupMemberId());
   CFSecurityTSecGroupMemberBuff buff;
   if (dictByPKey.containsKey(key)) {
     buff = dictByPKey.get(key);
   } else {
     buff = null;
   }
   return (buff);
 }
  public void forgetMemo(ICFCrmMemoObj Obj, boolean forgetSubObjects) {
    ICFCrmMemoObj obj = Obj;
    CFCrmMemoPKey pkey = obj.getPKey();
    if (members.containsKey(pkey)) {
      ICFCrmMemoObj keepObj = members.get(pkey);
      // Detach object from alternate, duplicate, all and PKey indexes

      if (indexByTenantIdx != null) {
        CFCrmMemoByTenantIdxKey keyTenantIdx =
            ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newTenantIdxKey();
        keyTenantIdx.setRequiredTenantId(keepObj.getRequiredTenantId());
        Map<CFCrmMemoPKey, ICFCrmMemoObj> mapTenantIdx = indexByTenantIdx.get(keyTenantIdx);
        if (mapTenantIdx != null) {
          mapTenantIdx.remove(keepObj.getPKey());
        }
      }

      if (indexByMemoContactIdx != null) {
        CFCrmMemoByMemoContactIdxKey keyMemoContactIdx =
            ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newMemoContactIdxKey();
        keyMemoContactIdx.setRequiredTenantId(keepObj.getRequiredTenantId());
        keyMemoContactIdx.setRequiredContactId(keepObj.getRequiredContactId());
        Map<CFCrmMemoPKey, ICFCrmMemoObj> mapMemoContactIdx =
            indexByMemoContactIdx.get(keyMemoContactIdx);
        if (mapMemoContactIdx != null) {
          mapMemoContactIdx.remove(keepObj.getPKey());
        }
      }

      if (indexByUDescrIdx != null) {
        CFCrmMemoByUDescrIdxKey keyUDescrIdx =
            ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newUDescrIdxKey();
        keyUDescrIdx.setRequiredTenantId(keepObj.getRequiredTenantId());
        keyUDescrIdx.setRequiredContactId(keepObj.getRequiredContactId());
        keyUDescrIdx.setRequiredDescription(keepObj.getRequiredDescription());
        indexByUDescrIdx.remove(keyUDescrIdx);
      }

      if (allMemo != null) {
        allMemo.remove(keepObj.getPKey());
      }
      members.remove(pkey);
      if (forgetSubObjects) {
        ((ICFCrmSchemaObj) schema)
            .getMemoTagTableObj()
            .forgetMemoTagByMemoIdx(keepObj.getRequiredTenantId(), keepObj.getRequiredMemoId());
      }
    }
  }
  public CFDbTestNumberDefBuff readDerivedByIdIdx(
      CFSecurityAuthorization Authorization, long TenantId, long Id) {
    final String S_ProcName = "CFDbTestRamValue.readDerivedByIdIdx() ";
    CFDbTestValuePKey key = schema.getFactoryValue().newPKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredId(Id);

    CFDbTestNumberDefBuff buff;
    if (dictByPKey.containsKey(key)) {
      buff = dictByPKey.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
 public void forgetISOCountryCurrencyByIdIdx(short ISOCountryId, short ISOCurrencyId) {
   if (members == null) {
     return;
   }
   CFSecurityISOCountryCurrencyPKey key =
       ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountryCurrency().newPKey();
   key.setRequiredISOCountryId(ISOCountryId);
   key.setRequiredISOCurrencyId(ISOCurrencyId);
   if (members.containsKey(key)) {
     ICFSecurityISOCountryCurrencyObj probed = members.get(key);
     if (probed != null) {
       probed.forget(true);
     }
   }
 }
  public CFDbTestReqMinMaxValueBuff readDerivedByUDescrIdx(
      CFSecurityAuthorization Authorization, long TenantId, String Description) {
    final String S_ProcName = "CFDbTestRamReqMinMaxValue.readDerivedByUDescrIdx";
    CFDbTestReqMinMaxValueByUDescrIdxKey key = schema.getFactoryReqMinMaxValue().newUDescrIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredDescription(Description);

    CFDbTestReqMinMaxValueBuff buff;
    if (dictByUDescrIdx.containsKey(key)) {
      buff = dictByUDescrIdx.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
  public CFSecurityHostNodeBuff readDerivedByHostNameIdx(
      CFSecurityAuthorization Authorization, long ClusterId, String HostName) {
    final String S_ProcName = "CFAccRamHostNode.readDerivedByHostNameIdx";
    CFSecurityHostNodeByHostNameIdxKey key = schema.getFactoryHostNode().newHostNameIdxKey();
    key.setRequiredClusterId(ClusterId);
    key.setRequiredHostName(HostName);

    CFSecurityHostNodeBuff buff;
    if (dictByHostNameIdx.containsKey(key)) {
      buff = dictByHostNameIdx.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
 public void forgetTSecGroupMemberByIdIdx(long TenantId, long TSecGroupMemberId) {
   if (members == null) {
     return;
   }
   CFSecurityTSecGroupMemberPKey key =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newPKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredTSecGroupMemberId(TSecGroupMemberId);
   if (members.containsKey(key)) {
     ICFSecurityTSecGroupMemberObj probed = members.get(key);
     if (probed != null) {
       probed.forget(true);
     }
   }
 }
  public CFBamDelSubDep3Buff readDerivedByUNameIdx(
      CFBamAuthorization Authorization, long ContTenantId, long ContDelDep2Id, String Name) {
    final String S_ProcName = "CFBamRamDelSubDep3.readDerivedByUNameIdx() ";
    CFBamDelSubDep3ByUNameIdxKey key = schema.getFactoryDelSubDep3().newUNameIdxKey();
    key.setRequiredContTenantId(ContTenantId);
    key.setRequiredContDelDep2Id(ContDelDep2Id);
    key.setRequiredName(Name);

    CFBamDelSubDep3Buff buff;
    if (dictByUNameIdx.containsKey(key)) {
      buff = dictByUNameIdx.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
  public CFSecuritySecGroupFormBuff readDerivedByUFormIdx(
      CFSecurityAuthorization Authorization, long ClusterId, int SecGroupId, int SecFormId) {
    final String S_ProcName = "CFInternetRamSecGroupForm.readDerivedByUFormIdx";
    CFSecuritySecGroupFormByUFormIdxKey key = schema.getFactorySecGroupForm().newUFormIdxKey();
    key.setRequiredClusterId(ClusterId);
    key.setRequiredSecGroupId(SecGroupId);
    key.setRequiredSecFormId(SecFormId);

    CFSecuritySecGroupFormBuff buff;
    if (dictByUFormIdx.containsKey(key)) {
      buff = dictByUFormIdx.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
  public CFSecurityTSecGroupMemberBuff readDerivedByUUserIdx(
      CFSecurityAuthorization Authorization, long TenantId, int TSecGroupId, UUID SecUserId) {
    final String S_ProcName = "CFSecurityRamTSecGroupMember.readDerivedByUUserIdx";
    CFSecurityTSecGroupMemberByUUserIdxKey key =
        schema.getFactoryTSecGroupMember().newUUserIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredTSecGroupId(TSecGroupId);
    key.setRequiredSecUserId(SecUserId);

    CFSecurityTSecGroupMemberBuff buff;
    if (dictByUUserIdx.containsKey(key)) {
      buff = dictByUUserIdx.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
  public void deleteHostNode(CFSecurityAuthorization Authorization, CFSecurityHostNodeBuff Buff) {
    final String S_ProcName = "CFAccRamHostNodeTable.deleteHostNode() ";
    CFSecurityHostNodePKey pkey = schema.getFactoryHostNode().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredHostNodeId(Buff.getRequiredHostNodeId());
    CFSecurityHostNodeBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteHostNode", pkey);
    }
    CFSecurityHostNodeByClusterIdxKey keyClusterIdx =
        schema.getFactoryHostNode().newClusterIdxKey();
    keyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFSecurityHostNodeByUDescrIdxKey keyUDescrIdx = schema.getFactoryHostNode().newUDescrIdxKey();
    keyUDescrIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    CFSecurityHostNodeByHostNameIdxKey keyHostNameIdx =
        schema.getFactoryHostNode().newHostNameIdxKey();
    keyHostNameIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyHostNameIdx.setRequiredHostName(existing.getRequiredHostName());

    // Validate reverse foreign keys

    // Delete is valid

    schema
        .getTableService()
        .deleteServiceByHostIdx(
            Authorization, Buff.getRequiredClusterId(), Buff.getRequiredHostNodeId());
    Map<CFSecurityHostNodePKey, CFSecurityHostNodeBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByClusterIdx.get(keyClusterIdx);
    subdict.remove(pkey);

    dictByUDescrIdx.remove(keyUDescrIdx);

    dictByHostNameIdx.remove(keyHostNameIdx);
  }
  public void forgetMemoByUDescrIdx(long TenantId, long ContactId, String Description) {
    if (indexByUDescrIdx == null) {
      return;
    }
    CFCrmMemoByUDescrIdxKey key =
        ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newUDescrIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredContactId(ContactId);
    key.setRequiredDescription(Description);
    if (indexByUDescrIdx.containsKey(key)) {
      ICFCrmMemoObj probed = indexByUDescrIdx.get(key);
      if (probed != null) {
        probed.forget(true);
      }

      indexByUDescrIdx.remove(key);
    }
  }