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 deleteMemoByMemoContactIdx(long TenantId, long ContactId) {
   CFCrmMemoByMemoContactIdxKey key =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newMemoContactIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredContactId(ContactId);
   if (indexByMemoContactIdx == null) {
     indexByMemoContactIdx =
         new HashMap<CFCrmMemoByMemoContactIdxKey, Map<CFCrmMemoPKey, ICFCrmMemoObj>>();
   }
   if (indexByMemoContactIdx.containsKey(key)) {
     Map<CFCrmMemoPKey, ICFCrmMemoObj> dict = indexByMemoContactIdx.get(key);
     ((ICFAccSchema) schema.getBackingStore())
         .getTableMemo()
         .deleteMemoByMemoContactIdx(schema.getAuthorization(), TenantId, ContactId);
     Iterator<ICFCrmMemoObj> iter = dict.values().iterator();
     ICFCrmMemoObj obj;
     List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexByMemoContactIdx.remove(key);
   } else {
     ((ICFAccSchema) schema.getBackingStore())
         .getTableMemo()
         .deleteMemoByMemoContactIdx(schema.getAuthorization(), TenantId, ContactId);
   }
 }
  public CFSecurityTSecGroupMemberBuff[] readDerivedByGroupIdx(
      CFSecurityAuthorization Authorization, long TenantId, int TSecGroupId) {
    final String S_ProcName = "CFSecurityRamTSecGroupMember.readDerivedByGroupIdx";
    CFSecurityTSecGroupMemberByGroupIdxKey key =
        schema.getFactoryTSecGroupMember().newGroupIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredTSecGroupId(TSecGroupId);

    CFSecurityTSecGroupMemberBuff[] recArray;
    if (dictByGroupIdx.containsKey(key)) {
      Map<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff> subdictGroupIdx =
          dictByGroupIdx.get(key);
      recArray = new CFSecurityTSecGroupMemberBuff[subdictGroupIdx.size()];
      Iterator<CFSecurityTSecGroupMemberBuff> iter = subdictGroupIdx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff> subdictGroupIdx =
          new HashMap<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff>();
      dictByGroupIdx.put(key, subdictGroupIdx);
      recArray = new CFSecurityTSecGroupMemberBuff[0];
    }
    return (recArray);
  }
  public void forgetISOCountryCurrencyByCurrencyIdx(short ISOCurrencyId) {
    if (indexByCurrencyIdx == null) {
      return;
    }
    CFSecurityISOCountryCurrencyByCurrencyIdxKey key =
        ((ICFInternetSchema) schema.getBackingStore())
            .getFactoryISOCountryCurrency()
            .newCurrencyIdxKey();
    key.setRequiredISOCurrencyId(ISOCurrencyId);
    if (indexByCurrencyIdx.containsKey(key)) {
      Map<CFSecurityISOCountryCurrencyPKey, ICFSecurityISOCountryCurrencyObj> mapCurrencyIdx =
          indexByCurrencyIdx.get(key);
      if (mapCurrencyIdx != null) {
        List<ICFSecurityISOCountryCurrencyObj> toForget =
            new LinkedList<ICFSecurityISOCountryCurrencyObj>();
        ICFSecurityISOCountryCurrencyObj cur = null;
        Iterator<ICFSecurityISOCountryCurrencyObj> iter = mapCurrencyIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByCurrencyIdx.remove(key);
    }
  }
 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 CFSecuritySecGroupFormBuff[] readDerivedByFormIdx(
      CFSecurityAuthorization Authorization, long ClusterId, int SecFormId) {
    final String S_ProcName = "CFInternetRamSecGroupForm.readDerivedByFormIdx";
    CFSecuritySecGroupFormByFormIdxKey key = schema.getFactorySecGroupForm().newFormIdxKey();
    key.setRequiredClusterId(ClusterId);
    key.setRequiredSecFormId(SecFormId);

    CFSecuritySecGroupFormBuff[] recArray;
    if (dictByFormIdx.containsKey(key)) {
      Map<CFSecuritySecGroupFormPKey, CFSecuritySecGroupFormBuff> subdictFormIdx =
          dictByFormIdx.get(key);
      recArray = new CFSecuritySecGroupFormBuff[subdictFormIdx.size()];
      Iterator<CFSecuritySecGroupFormBuff> iter = subdictFormIdx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFSecuritySecGroupFormPKey, CFSecuritySecGroupFormBuff> subdictFormIdx =
          new HashMap<CFSecuritySecGroupFormPKey, CFSecuritySecGroupFormBuff>();
      dictByFormIdx.put(key, subdictFormIdx);
      recArray = new CFSecuritySecGroupFormBuff[0];
    }
    return (recArray);
  }
  public CFBamDelSubDep3Buff[] readDerivedByContDelDep2Idx(
      CFBamAuthorization Authorization, long ContTenantId, long ContDelDep2Id) {
    final String S_ProcName = "CFBamRamDelSubDep3.readDerivedByContDelDep2Idx() ";
    CFBamDelSubDep3ByContDelDep2IdxKey key = schema.getFactoryDelSubDep3().newContDelDep2IdxKey();
    key.setRequiredContTenantId(ContTenantId);
    key.setRequiredContDelDep2Id(ContDelDep2Id);

    CFBamDelSubDep3Buff[] recArray;
    if (dictByContDelDep2Idx.containsKey(key)) {
      Map<CFBamScopePKey, CFBamDelSubDep3Buff> subdictContDelDep2Idx =
          dictByContDelDep2Idx.get(key);
      recArray = new CFBamDelSubDep3Buff[subdictContDelDep2Idx.size()];
      Iterator<CFBamDelSubDep3Buff> iter = subdictContDelDep2Idx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFBamScopePKey, CFBamDelSubDep3Buff> subdictContDelDep2Idx =
          new HashMap<CFBamScopePKey, CFBamDelSubDep3Buff>();
      dictByContDelDep2Idx.put(key, subdictContDelDep2Idx);
      recArray = new CFBamDelSubDep3Buff[0];
    }
    return (recArray);
  }
  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 void forgetTSecGroupMemberByUserIdx(UUID SecUserId) {
    if (indexByUserIdx == null) {
      return;
    }
    CFSecurityTSecGroupMemberByUserIdxKey key =
        ((ICFBamSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newUserIdxKey();
    key.setRequiredSecUserId(SecUserId);
    if (indexByUserIdx.containsKey(key)) {
      Map<CFSecurityTSecGroupMemberPKey, ICFSecurityTSecGroupMemberObj> mapUserIdx =
          indexByUserIdx.get(key);
      if (mapUserIdx != null) {
        List<ICFSecurityTSecGroupMemberObj> toForget =
            new LinkedList<ICFSecurityTSecGroupMemberObj>();
        ICFSecurityTSecGroupMemberObj cur = null;
        Iterator<ICFSecurityTSecGroupMemberObj> iter = mapUserIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByUserIdx.remove(key);
    }
  }
 public List<ICFCrmMemoObj> readAllMemo(boolean forceRead) {
   final String S_ProcName = "readAllMemo";
   if ((allMemo == null) || forceRead) {
     Map<CFCrmMemoPKey, ICFCrmMemoObj> map = new HashMap<CFCrmMemoPKey, ICFCrmMemoObj>();
     allMemo = map;
     CFCrmMemoBuff[] buffList =
         ((ICFAccSchema) schema.getBackingStore())
             .getTableMemo()
             .readAllDerived(schema.getAuthorization());
     CFCrmMemoBuff buff;
     ICFCrmMemoObj obj;
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       obj = newInstance();
       obj.setPKey(((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newPKey());
       obj.setBuff(buff);
       ICFCrmMemoObj realized = (ICFCrmMemoObj) obj.realize();
     }
   }
   Comparator<ICFCrmMemoObj> cmp =
       new Comparator<ICFCrmMemoObj>() {
         public int compare(ICFCrmMemoObj lhs, ICFCrmMemoObj rhs) {
           if (lhs == null) {
             if (rhs == null) {
               return (0);
             } else {
               return (-1);
             }
           } else if (rhs == null) {
             return (1);
           } else {
             CFCrmMemoPKey lhsPKey = lhs.getPKey();
             CFCrmMemoPKey rhsPKey = rhs.getPKey();
             int ret = lhsPKey.compareTo(rhsPKey);
             return (ret);
           }
         }
       };
   int len = allMemo.size();
   ICFCrmMemoObj arr[] = new ICFCrmMemoObj[len];
   Iterator<ICFCrmMemoObj> valIter = allMemo.values().iterator();
   int idx = 0;
   while ((idx < len) && valIter.hasNext()) {
     arr[idx++] = valIter.next();
   }
   if (idx < len) {
     throw CFLib.getDefaultExceptionFactory()
         .newArgumentUnderflowException(getClass(), S_ProcName, 0, "idx", idx, len);
   } else if (valIter.hasNext()) {
     throw CFLib.getDefaultExceptionFactory()
         .newArgumentOverflowException(getClass(), S_ProcName, 0, "idx", idx, len);
   }
   Arrays.sort(arr, cmp);
   ArrayList<ICFCrmMemoObj> arrayList = new ArrayList<ICFCrmMemoObj>(len);
   for (idx = 0; idx < len; idx++) {
     arrayList.add(arr[idx]);
   }
   List<ICFCrmMemoObj> sortedList = arrayList;
   return (sortedList);
 }
 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 void deleteClearTopDepByTenantIdx(long TenantId) {
   CFBamScopeByTenantIdxKey key = schema.getBackingStore().getFactoryScope().newTenantIdxKey();
   key.setRequiredTenantId(TenantId);
   if (indexByTenantIdx == null) {
     indexByTenantIdx =
         new HashMap<CFBamScopeByTenantIdxKey, Map<CFBamScopePKey, ICFBamClearTopDepObj>>();
   }
   if (indexByTenantIdx.containsKey(key)) {
     Map<CFBamScopePKey, ICFBamClearTopDepObj> dict = indexByTenantIdx.get(key);
     schema
         .getBackingStore()
         .getTableClearTopDep()
         .deleteClearTopDepByTenantIdx(schema.getAuthorization(), TenantId);
     Iterator<ICFBamClearTopDepObj> iter = dict.values().iterator();
     ICFBamClearTopDepObj obj;
     List<ICFBamClearTopDepObj> toForget = new LinkedList<ICFBamClearTopDepObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexByTenantIdx.remove(key);
   } else {
     schema
         .getBackingStore()
         .getTableClearTopDep()
         .deleteClearTopDepByTenantIdx(schema.getAuthorization(), TenantId);
   }
 }
  public void forgetMemoByMemoContactIdx(long TenantId, long ContactId) {
    if (indexByMemoContactIdx == null) {
      return;
    }
    CFCrmMemoByMemoContactIdxKey key =
        ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newMemoContactIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredContactId(ContactId);
    if (indexByMemoContactIdx.containsKey(key)) {
      Map<CFCrmMemoPKey, ICFCrmMemoObj> mapMemoContactIdx = indexByMemoContactIdx.get(key);
      if (mapMemoContactIdx != null) {
        List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
        ICFCrmMemoObj cur = null;
        Iterator<ICFCrmMemoObj> iter = mapMemoContactIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByMemoContactIdx.remove(key);
    }
  }
 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 forgetClearTopDepByContTblIdx(long TenantId, long ContTableId) {
    if (indexByContTblIdx == null) {
      return;
    }
    CFBamClearTopDepByContTblIdxKey key =
        schema.getBackingStore().getFactoryClearTopDep().newContTblIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredContTableId(ContTableId);
    if (indexByContTblIdx.containsKey(key)) {
      Map<CFBamScopePKey, ICFBamClearTopDepObj> mapContTblIdx = indexByContTblIdx.get(key);
      if (mapContTblIdx != null) {
        List<ICFBamClearTopDepObj> toForget = new LinkedList<ICFBamClearTopDepObj>();
        ICFBamClearTopDepObj cur = null;
        Iterator<ICFBamClearTopDepObj> iter = mapContTblIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByContTblIdx.remove(key);
    }
  }
 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 CFBamISOCurrencyBuff[] readAllDerived(CFBamAuthorization Authorization) {
   final String S_ProcName = "CFBamRamISOCurrency.readAllDerived() ";
   CFBamISOCurrencyBuff[] retList = new CFBamISOCurrencyBuff[dictByPKey.values().size()];
   Iterator<CFBamISOCurrencyBuff> iter = dictByPKey.values().iterator();
   int idx = 0;
   while (iter.hasNext()) {
     retList[idx++] = iter.next();
   }
   return (retList);
 }
 public CFDbTestNumberDefBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "CFDbTestRamNumberDef.readAllDerived";
   CFDbTestNumberDefBuff[] retList = new CFDbTestNumberDefBuff[dictByPKey.values().size()];
   Iterator<CFDbTestNumberDefBuff> iter = dictByPKey.values().iterator();
   int idx = 0;
   while (iter.hasNext()) {
     retList[idx++] = iter.next();
   }
   return (retList);
 }
 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 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 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 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 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 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 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 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);
  }