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 CFBamISOCurrencyBuff[] readAllBuff(CFBamAuthorization Authorization) {
   final String S_ProcName = "CFBamRamISOCurrency.readAllBuff() ";
   CFBamISOCurrencyBuff buff;
   ArrayList<CFBamISOCurrencyBuff> filteredList = new ArrayList<CFBamISOCurrencyBuff>();
   CFBamISOCurrencyBuff[] buffList = readAllDerived(Authorization);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("ISCY")) {
       filteredList.add(buff);
     }
   }
   return (filteredList.toArray(new CFBamISOCurrencyBuff[0]));
 }
 public CFDbTestNumberDefBuff[] readAllBuff(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "CFDbTestRamNumberDef.readAllBuff";
   CFDbTestNumberDefBuff buff;
   ArrayList<CFDbTestNumberDefBuff> filteredList = new ArrayList<CFDbTestNumberDefBuff>();
   CFDbTestNumberDefBuff[] buffList = readAllDerived(Authorization);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("NUMD")) {
       filteredList.add(buff);
     }
   }
   return (filteredList.toArray(new CFDbTestNumberDefBuff[0]));
 }
 public CFDbTestNumberDefBuff[] readBuffByNextIdx(
     CFSecurityAuthorization Authorization, Long NextTenantId, Long NextId) {
   final String S_ProcName = "CFDbTestRamValue.readBuffByNextIdx() ";
   CFDbTestNumberDefBuff buff;
   ArrayList<CFDbTestNumberDefBuff> filteredList = new ArrayList<CFDbTestNumberDefBuff>();
   CFDbTestNumberDefBuff[] buffList = readDerivedByNextIdx(Authorization, NextTenantId, NextId);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("VALU")) {
       filteredList.add((CFDbTestNumberDefBuff) buff);
     }
   }
   return (filteredList.toArray(new CFDbTestNumberDefBuff[0]));
 }
 public CFBamDelSubDep3Buff[] readBuffByTableIdx(
     CFBamAuthorization Authorization, long RelationTenantId, long RelationId) {
   final String S_ProcName = "CFBamRamDelDep.readBuffByTableIdx() ";
   CFBamDelDepBuff buff;
   ArrayList<CFBamDelSubDep3Buff> filteredList = new ArrayList<CFBamDelSubDep3Buff>();
   CFBamDelDepBuff[] buffList = readDerivedByTableIdx(Authorization, RelationTenantId, RelationId);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("DELD")) {
       filteredList.add((CFBamDelSubDep3Buff) buff);
     }
   }
   return (filteredList.toArray(new CFBamDelSubDep3Buff[0]));
 }
 public CFSecurityHostNodeBuff[] readBuffByClusterIdx(
     CFSecurityAuthorization Authorization, long ClusterId) {
   final String S_ProcName = "CFAccRamHostNode.readBuffByClusterIdx() ";
   CFSecurityHostNodeBuff buff;
   ArrayList<CFSecurityHostNodeBuff> filteredList = new ArrayList<CFSecurityHostNodeBuff>();
   CFSecurityHostNodeBuff[] buffList = readDerivedByClusterIdx(Authorization, ClusterId);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("HSND")) {
       filteredList.add((CFSecurityHostNodeBuff) buff);
     }
   }
   return (filteredList.toArray(new CFSecurityHostNodeBuff[0]));
 }
 public CFSecurityTSecGroupMemberBuff[] readBuffByUserIdx(
     CFSecurityAuthorization Authorization, UUID SecUserId) {
   final String S_ProcName = "CFSecurityRamTSecGroupMember.readBuffByUserIdx() ";
   CFSecurityTSecGroupMemberBuff buff;
   ArrayList<CFSecurityTSecGroupMemberBuff> filteredList =
       new ArrayList<CFSecurityTSecGroupMemberBuff>();
   CFSecurityTSecGroupMemberBuff[] buffList = readDerivedByUserIdx(Authorization, SecUserId);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("TGMB")) {
       filteredList.add((CFSecurityTSecGroupMemberBuff) buff);
     }
   }
   return (filteredList.toArray(new CFSecurityTSecGroupMemberBuff[0]));
 }
 public CFSecuritySecGroupFormBuff[] readBuffByAppIdx(
     CFSecurityAuthorization Authorization, long ClusterId, int SecAppId) {
   final String S_ProcName = "CFInternetRamSecGroupForm.readBuffByAppIdx() ";
   CFSecuritySecGroupFormBuff buff;
   ArrayList<CFSecuritySecGroupFormBuff> filteredList =
       new ArrayList<CFSecuritySecGroupFormBuff>();
   CFSecuritySecGroupFormBuff[] buffList = readDerivedByAppIdx(Authorization, ClusterId, SecAppId);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("SGFM")) {
       filteredList.add((CFSecuritySecGroupFormBuff) buff);
     }
   }
   return (filteredList.toArray(new CFSecuritySecGroupFormBuff[0]));
 }
 public CFDbTestNumberDefBuff[] readDerivedByNextIdx(
     CFSecurityAuthorization Authorization, Long NextTenantId, Long NextId) {
   final String S_ProcName = "CFDbTestRamValue.readDerivedByNextIdx";
   CFDbTestValueBuff buffList[] =
       schema.getTableValue().readDerivedByNextIdx(Authorization, NextTenantId, NextId);
   if (buffList == null) {
     return (null);
   } else {
     CFDbTestValueBuff buff;
     ArrayList<CFDbTestNumberDefBuff> filteredList = new ArrayList<CFDbTestNumberDefBuff>();
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       if ((buff != null) && (buff instanceof CFDbTestNumberDefBuff)) {
         filteredList.add((CFDbTestNumberDefBuff) buff);
       }
     }
     return (filteredList.toArray(new CFDbTestNumberDefBuff[0]));
   }
 }
 public CFBamDelSubDep3Buff[] readDerivedByTableIdx(
     CFBamAuthorization Authorization, long RelationTenantId, long RelationId) {
   final String S_ProcName = "CFBamRamDelDep.readDerivedByTableIdx() ";
   CFBamDelDepBuff buffList[] =
       schema.getTableDelDep().readDerivedByTableIdx(Authorization, RelationTenantId, RelationId);
   if (buffList == null) {
     return (null);
   } else {
     CFBamDelDepBuff buff;
     ArrayList<CFBamDelSubDep3Buff> filteredList = new ArrayList<CFBamDelSubDep3Buff>();
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       if ((buff != null) && (buff instanceof CFBamDelSubDep3Buff)) {
         filteredList.add((CFBamDelSubDep3Buff) buff);
       }
     }
     return (filteredList.toArray(new CFBamDelSubDep3Buff[0]));
   }
 }
 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);
 }