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 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 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 List<ICFSecurityISOCountryCurrencyObj> readISOCountryCurrencyByCurrencyIdx(
     short ISOCurrencyId, boolean forceRead) {
   final String S_ProcName = "readISOCountryCurrencyByCurrencyIdx";
   CFSecurityISOCountryCurrencyByCurrencyIdxKey key =
       ((ICFInternetSchema) schema.getBackingStore())
           .getFactoryISOCountryCurrency()
           .newCurrencyIdxKey();
   key.setRequiredISOCurrencyId(ISOCurrencyId);
   Map<CFSecurityISOCountryCurrencyPKey, ICFSecurityISOCountryCurrencyObj> dict;
   if (indexByCurrencyIdx == null) {
     indexByCurrencyIdx =
         new HashMap<
             CFSecurityISOCountryCurrencyByCurrencyIdxKey,
             Map<CFSecurityISOCountryCurrencyPKey, ICFSecurityISOCountryCurrencyObj>>();
   }
   if ((!forceRead) && indexByCurrencyIdx.containsKey(key)) {
     dict = indexByCurrencyIdx.get(key);
   } else {
     dict = new HashMap<CFSecurityISOCountryCurrencyPKey, ICFSecurityISOCountryCurrencyObj>();
     // Allow other threads to dirty-read while we're loading
     indexByCurrencyIdx.put(key, dict);
     ICFSecurityISOCountryCurrencyObj obj;
     CFSecurityISOCountryCurrencyBuff[] buffList =
         ((ICFInternetSchema) schema.getBackingStore())
             .getTableISOCountryCurrency()
             .readDerivedByCurrencyIdx(schema.getAuthorization(), ISOCurrencyId);
     CFSecurityISOCountryCurrencyBuff buff;
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       obj = schema.getISOCountryCurrencyTableObj().newInstance();
       obj.setPKey(
           ((ICFInternetSchema) schema.getBackingStore())
               .getFactoryISOCountryCurrency()
               .newPKey());
       obj.setBuff(buff);
       ICFSecurityISOCountryCurrencyObj realized =
           (ICFSecurityISOCountryCurrencyObj) obj.realize();
     }
   }
   Comparator<ICFSecurityISOCountryCurrencyObj> cmp =
       new Comparator<ICFSecurityISOCountryCurrencyObj>() {
         public int compare(
             ICFSecurityISOCountryCurrencyObj lhs, ICFSecurityISOCountryCurrencyObj rhs) {
           if (lhs == null) {
             if (rhs == null) {
               return (0);
             } else {
               return (-1);
             }
           } else if (rhs == null) {
             return (1);
           } else {
             CFSecurityISOCountryCurrencyPKey lhsPKey = lhs.getPKey();
             CFSecurityISOCountryCurrencyPKey rhsPKey = rhs.getPKey();
             int ret = lhsPKey.compareTo(rhsPKey);
             return (ret);
           }
         }
       };
   int len = dict.size();
   ICFSecurityISOCountryCurrencyObj arr[] = new ICFSecurityISOCountryCurrencyObj[len];
   Iterator<ICFSecurityISOCountryCurrencyObj> valIter = dict.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<ICFSecurityISOCountryCurrencyObj> arrayList =
       new ArrayList<ICFSecurityISOCountryCurrencyObj>(len);
   for (idx = 0; idx < len; idx++) {
     arrayList.add(arr[idx]);
   }
   List<ICFSecurityISOCountryCurrencyObj> sortedList = arrayList;
   return (sortedList);
 }