public void setRequiredContainerParentDomain(ICFInternetDomainBaseObj value) {
   if (buff == null) {
     getSchemaDefBuff();
   }
   requiredContainerParentDomain = null;
   requiredOwnerCTenant = null;
   if (value != null) {
     getPKey().setRequiredTenantId(value.getRequiredTenantId());
     getSchemaDefBuff().setRequiredTenantId(value.getRequiredTenantId());
     getSchemaDefBuff().setRequiredDomainId(value.getRequiredId());
   }
   requiredContainerParentDomain = value;
 }
 public ICFInternetDomainBaseObj getRequiredContainerParentDomain(boolean forceRead) {
   if (forceRead || (requiredContainerParentDomain == null)) {
     boolean anyMissing = false;
     if (!anyMissing) {
       ICFInternetDomainBaseObj obj =
           ((ICFDbTestSchemaObj) getOrigAsSchemaDef().getSchema())
               .getDomainBaseTableObj()
               .readDomainBaseByIdIdx(
                   getPKey().getRequiredTenantId(), getSchemaDefBuff().getRequiredDomainId());
       requiredContainerParentDomain = obj;
       if (obj != null) {
         getSchemaDefBuff().setRequiredTenantId(obj.getRequiredTenantId());
         getSchemaDefBuff().setRequiredDomainId(obj.getRequiredId());
         requiredContainerParentDomain = obj;
       }
     }
   }
   return (requiredContainerParentDomain);
 }
 public List<ICFInternetDomainObj> readDomainByTenantIdx(long TenantId, boolean forceRead) {
   final String S_ProcName = "readDomainByTenantIdx";
   CFInternetDomainBaseByTenantIdxKey key =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryDomainBase().newTenantIdxKey();
   key.setRequiredTenantId(TenantId);
   Map<CFInternetDomainBasePKey, ICFInternetDomainObj> dict;
   if (indexByTenantIdx == null) {
     indexByTenantIdx =
         new HashMap<
             CFInternetDomainBaseByTenantIdxKey,
             Map<CFInternetDomainBasePKey, ICFInternetDomainObj>>();
   }
   if ((!forceRead) && indexByTenantIdx.containsKey(key)) {
     dict = indexByTenantIdx.get(key);
   } else {
     dict = new HashMap<CFInternetDomainBasePKey, ICFInternetDomainObj>();
     // Allow other threads to dirty-read while we're loading
     indexByTenantIdx.put(key, dict);
     ICFInternetDomainBaseObj obj;
     CFInternetDomainBaseBuff[] buffList =
         ((ICFBamSchema) schema.getBackingStore())
             .getTableDomainBase()
             .readDerivedByTenantIdx(schema.getAuthorization(), TenantId);
     CFInternetDomainBaseBuff buff;
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       obj =
           (ICFInternetDomainObj)
               schema.getDomainBaseTableObj().constructByClassCode(buff.getClassCode());
       obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDomainBase().newPKey());
       obj.setBuff(buff);
       ICFInternetDomainObj realized = (ICFInternetDomainObj) obj.realize();
     }
   }
   Comparator<ICFInternetDomainObj> cmp =
       new Comparator<ICFInternetDomainObj>() {
         public int compare(ICFInternetDomainObj lhs, ICFInternetDomainObj rhs) {
           if (lhs == null) {
             if (rhs == null) {
               return (0);
             } else {
               return (-1);
             }
           } else if (rhs == null) {
             return (1);
           } else {
             CFInternetDomainBasePKey lhsPKey = lhs.getPKey();
             CFInternetDomainBasePKey rhsPKey = rhs.getPKey();
             int ret = lhsPKey.compareTo(rhsPKey);
             return (ret);
           }
         }
       };
   int len = dict.size();
   ICFInternetDomainObj arr[] = new ICFInternetDomainObj[len];
   Iterator<ICFInternetDomainObj> 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<ICFInternetDomainObj> arrayList = new ArrayList<ICFInternetDomainObj>(len);
   for (idx = 0; idx < len; idx++) {
     arrayList.add(arr[idx]);
   }
   List<ICFInternetDomainObj> sortedList = arrayList;
   return (sortedList);
 }