public void createLoaderBehaviour(
      CFSecurityAuthorization Authorization, CFDbTestLoaderBehaviourBuff Buff) {
    final String S_ProcName = "createLoaderBehaviour";
    CFDbTestLoaderBehaviourPKey pkey = schema.getFactoryLoaderBehaviour().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    Buff.setRequiredId(pkey.getRequiredId());
    CFDbTestLoaderBehaviourByUNameIdxKey keyUNameIdx =
        schema.getFactoryLoaderBehaviour().newUNameIdxKey();
    keyUNameIdx.setRequiredName(Buff.getRequiredName());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
      throw CFLib.getDefaultExceptionFactory()
          .newPrimaryKeyNotNewException(getClass(), S_ProcName, pkey);
    }

    if (dictByUNameIdx.containsKey(keyUNameIdx)) {
      throw CFLib.getDefaultExceptionFactory()
          .newUniqueIndexViolationException(
              getClass(), S_ProcName, "LoaderBehaviourUNameIdx", keyUNameIdx);
    }

    // Validate foreign keys

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    dictByUNameIdx.put(keyUNameIdx, Buff);
  }
  public void createOptFullRange(
      CFSecurityAuthorization Authorization, CFDbTestOptFullRangeBuff Buff) {
    final String S_ProcName = "createOptFullRange";
    CFDbTestOptFullRangePKey pkey = schema.getFactoryOptFullRange().newPKey();
    pkey.setRequiredId(schema.nextOptFullRangeIdGen());
    Buff.setRequiredId(pkey.getRequiredId());
    CFDbTestOptFullRangeByUDescrIdxKey keyUDescrIdx =
        schema.getFactoryOptFullRange().newUDescrIdxKey();
    keyUDescrIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keyUDescrIdx.setRequiredDescription(Buff.getRequiredDescription());

    CFDbTestOptFullRangeByTenantIdxKey keyTenantIdx =
        schema.getFactoryOptFullRange().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
      throw CFLib.getDefaultExceptionFactory()
          .newPrimaryKeyNotNewException(getClass(), S_ProcName, pkey);
    }

    if (dictByUDescrIdx.containsKey(keyUDescrIdx)) {
      throw CFLib.getDefaultExceptionFactory()
          .newUniqueIndexViolationException(
              getClass(), S_ProcName, "OptFullRangeUDescrIdx", keyUDescrIdx);
    }

    // Validate foreign keys

    {
      boolean allNull = true;
      allNull = false;
      if (!allNull) {
        if (null
            == schema
                .getTableTenant()
                .readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
          throw CFLib.getDefaultExceptionFactory()
              .newUnresolvedRelationException(
                  getClass(), S_ProcName, "Container", "Tenant", "Tenant", null);
        }
      }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    dictByUDescrIdx.put(keyUDescrIdx, Buff);

    Map<CFDbTestOptFullRangePKey, CFDbTestOptFullRangeBuff> subdictTenantIdx;
    if (dictByTenantIdx.containsKey(keyTenantIdx)) {
      subdictTenantIdx = dictByTenantIdx.get(keyTenantIdx);
    } else {
      subdictTenantIdx = new HashMap<CFDbTestOptFullRangePKey, CFDbTestOptFullRangeBuff>();
      dictByTenantIdx.put(keyTenantIdx, subdictTenantIdx);
    }
    subdictTenantIdx.put(pkey, Buff);
  }
  public void deleteOptFullRange(
      CFSecurityAuthorization Authorization, CFDbTestOptFullRangeBuff Buff) {
    final String S_ProcName = "CFDbTestRamOptFullRangeTable.deleteOptFullRange() ";
    CFDbTestOptFullRangePKey pkey = schema.getFactoryOptFullRange().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    CFDbTestOptFullRangeBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteOptFullRange", pkey);
    }
    CFDbTestOptFullRangeByUDescrIdxKey keyUDescrIdx =
        schema.getFactoryOptFullRange().newUDescrIdxKey();
    keyUDescrIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    CFDbTestOptFullRangeByTenantIdxKey keyTenantIdx =
        schema.getFactoryOptFullRange().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    // Validate reverse foreign keys

    // Delete is valid

    Map<CFDbTestOptFullRangePKey, CFDbTestOptFullRangeBuff> subdict;

    dictByPKey.remove(pkey);

    dictByUDescrIdx.remove(keyUDescrIdx);

    subdict = dictByTenantIdx.get(keyTenantIdx);
    subdict.remove(pkey);
  }
 public void deleteNumberDefByNextIdx(
     CFSecurityAuthorization Authorization, CFDbTestValueByNextIdxKey argKey) {
   final String S_ProcName = "deleteNumberDefByNextIdx";
   CFDbTestNumberDefBuff cur;
   LinkedList<CFDbTestNumberDefBuff> matchSet = new LinkedList<CFDbTestNumberDefBuff>();
   Iterator<CFDbTestNumberDefBuff> values = dictByPKey.values().iterator();
   while (values.hasNext()) {
     cur = values.next();
     if (argKey.equals(cur)) {
       matchSet.add(cur);
     }
   }
   Iterator<CFDbTestNumberDefBuff> iterMatch = matchSet.iterator();
   while (iterMatch.hasNext()) {
     cur = iterMatch.next();
     String subClassCode = cur.getClassCode();
     if ("NUMD".equals(subClassCode)) {
       schema.getTableNumberDef().deleteNumberDef(Authorization, cur);
     } else if ("NUMC".equals(subClassCode)) {
       schema.getTableNumberCol().deleteNumberCol(Authorization, (CFDbTestNumberColBuff) cur);
     } else if ("NUMT".equals(subClassCode)) {
       schema.getTableNumberType().deleteNumberType(Authorization, (CFDbTestNumberTypeBuff) cur);
     } else {
       throw CFLib.getDefaultExceptionFactory()
           .newUnsupportedClassException(
               getClass(),
               S_ProcName,
               "subClassCode",
               cur,
               "Instance of or subclass of NumberDef must not be \"" + subClassCode + "\"");
     }
   }
 }
  public void deleteLoaderBehaviour(
      CFSecurityAuthorization Authorization, CFDbTestLoaderBehaviourBuff Buff) {
    final String S_ProcName = "CFDbTestRamLoaderBehaviourTable.deleteLoaderBehaviour() ";
    CFDbTestLoaderBehaviourPKey pkey = schema.getFactoryLoaderBehaviour().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    CFDbTestLoaderBehaviourBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteLoaderBehaviour", pkey);
    }
    CFDbTestLoaderBehaviourByUNameIdxKey keyUNameIdx =
        schema.getFactoryLoaderBehaviour().newUNameIdxKey();
    keyUNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    Map<CFDbTestLoaderBehaviourPKey, CFDbTestLoaderBehaviourBuff> subdict;

    dictByPKey.remove(pkey);

    dictByUNameIdx.remove(keyUNameIdx);
  }
  public void updateLoaderBehaviour(
      CFSecurityAuthorization Authorization, CFDbTestLoaderBehaviourBuff Buff) {
    CFDbTestLoaderBehaviourPKey pkey = schema.getFactoryLoaderBehaviour().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    CFDbTestLoaderBehaviourBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newStaleCacheDetectedException(
              getClass(),
              "updateLoaderBehaviour",
              "Existing record not found",
              "LoaderBehaviour",
              pkey);
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "updateLoaderBehaviour", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFDbTestLoaderBehaviourByUNameIdxKey existingKeyUNameIdx =
        schema.getFactoryLoaderBehaviour().newUNameIdxKey();
    existingKeyUNameIdx.setRequiredName(existing.getRequiredName());

    CFDbTestLoaderBehaviourByUNameIdxKey newKeyUNameIdx =
        schema.getFactoryLoaderBehaviour().newUNameIdxKey();
    newKeyUNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    if (!existingKeyUNameIdx.equals(newKeyUNameIdx)) {
      if (dictByUNameIdx.containsKey(newKeyUNameIdx)) {
        throw CFLib.getDefaultExceptionFactory()
            .newUniqueIndexViolationException(
                getClass(), "updateLoaderBehaviour", "LoaderBehaviourUNameIdx", newKeyUNameIdx);
      }
    }

    // Validate foreign keys

    // Update is valid

    Map<CFDbTestLoaderBehaviourPKey, CFDbTestLoaderBehaviourBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    dictByUNameIdx.remove(existingKeyUNameIdx);
    dictByUNameIdx.put(newKeyUNameIdx, Buff);
  }
 public void deleteNumberDefByScopeIdx(
     CFSecurityAuthorization Authorization, long argTenantId, long argScopeId) {
   CFDbTestValueByScopeIdxKey key = schema.getFactoryValue().newScopeIdxKey();
   key.setRequiredTenantId(argTenantId);
   key.setRequiredScopeId(argScopeId);
   deleteNumberDefByScopeIdx(Authorization, key);
 }
 public void deleteReqMinMaxValueByUDescrIdx(
     CFSecurityAuthorization Authorization, long argTenantId, String argDescription) {
   CFDbTestReqMinMaxValueByUDescrIdxKey key = schema.getFactoryReqMinMaxValue().newUDescrIdxKey();
   key.setRequiredTenantId(argTenantId);
   key.setRequiredDescription(argDescription);
   deleteReqMinMaxValueByUDescrIdx(Authorization, key);
 }
 public void deleteReqMinMaxValueByIdIdx(
     CFSecurityAuthorization Authorization, long argTenantId, long argId) {
   CFDbTestReqMinMaxValuePKey key = schema.getFactoryReqMinMaxValue().newPKey();
   key.setRequiredTenantId(argTenantId);
   key.setRequiredId(argId);
   deleteReqMinMaxValueByIdIdx(Authorization, key);
 }
 public void deleteNumberDefByNextIdx(
     CFSecurityAuthorization Authorization, Long argNextTenantId, Long argNextId) {
   CFDbTestValueByNextIdxKey key = schema.getFactoryValue().newNextIdxKey();
   key.setOptionalNextTenantId(argNextTenantId);
   key.setOptionalNextId(argNextId);
   deleteNumberDefByNextIdx(Authorization, key);
 }
  public void deleteNumberDef(CFSecurityAuthorization Authorization, CFDbTestNumberDefBuff Buff) {
    final String S_ProcName = "CFDbTestRamNumberDefTable.deleteNumberDef() ";
    CFDbTestValuePKey pkey = schema.getFactoryValue().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFDbTestNumberDefBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteNumberDef", pkey);
    }

    // Validate reverse foreign keys

    if (schema
            .getTableNumberCol()
            .readDerivedByIdIdx(
                Authorization, existing.getRequiredTenantId(), existing.getRequiredId())
        != null) {
      throw CFLib.getDefaultExceptionFactory()
          .newDependentsDetectedException(
              getClass(), "deleteNumberDef", "Superclass", "SuperClass", "NumberCol", pkey);
    }

    if (schema
            .getTableNumberType()
            .readDerivedByIdIdx(
                Authorization, existing.getRequiredTenantId(), existing.getRequiredId())
        != null) {
      throw CFLib.getDefaultExceptionFactory()
          .newDependentsDetectedException(
              getClass(), "deleteNumberDef", "Superclass", "SuperClass", "NumberType", pkey);
    }

    // Delete is valid

    Map<CFDbTestValuePKey, CFDbTestNumberDefBuff> subdict;

    dictByPKey.remove(pkey);

    schema.getTableAtom().deleteAtom(Authorization, Buff);
  }
  public void createCluster(CFSecurityAuthorization Authorization, CFSecurityClusterBuff Buff) {
    final String S_ProcName = "createCluster";
    CFSecurityClusterPKey pkey = schema.getFactoryCluster().newPKey();
    pkey.setRequiredId(schema.nextClusterIdGen());
    Buff.setRequiredId(pkey.getRequiredId());
    CFSecurityClusterByUDomainNameIdxKey keyUDomainNameIdx =
        schema.getFactoryCluster().newUDomainNameIdxKey();
    keyUDomainNameIdx.setRequiredFullDomainName(Buff.getRequiredFullDomainName());

    CFSecurityClusterByUDescrIdxKey keyUDescrIdx = schema.getFactoryCluster().newUDescrIdxKey();
    keyUDescrIdx.setRequiredDescription(Buff.getRequiredDescription());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
      throw CFLib.getDefaultExceptionFactory()
          .newPrimaryKeyNotNewException(getClass(), S_ProcName, pkey);
    }

    if (dictByUDomainNameIdx.containsKey(keyUDomainNameIdx)) {
      throw CFLib.getDefaultExceptionFactory()
          .newUniqueIndexViolationException(
              getClass(), S_ProcName, "ClusterUDomainNameIdx", keyUDomainNameIdx);
    }

    if (dictByUDescrIdx.containsKey(keyUDescrIdx)) {
      throw CFLib.getDefaultExceptionFactory()
          .newUniqueIndexViolationException(
              getClass(), S_ProcName, "ClusterUDescrNameIdx", keyUDescrIdx);
    }

    // Validate foreign keys

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    dictByUDomainNameIdx.put(keyUDomainNameIdx, Buff);

    dictByUDescrIdx.put(keyUDescrIdx, Buff);
  }
 public CFDbTestLoaderBehaviourBuff readDerived(
     CFSecurityAuthorization Authorization, CFDbTestLoaderBehaviourPKey PKey) {
   final String S_ProcName = "CFDbTestRamLoaderBehaviour.readDerived";
   CFDbTestLoaderBehaviourPKey key = schema.getFactoryLoaderBehaviour().newPKey();
   key.setRequiredId(PKey.getRequiredId());
   CFDbTestLoaderBehaviourBuff buff;
   if (dictByPKey.containsKey(key)) {
     buff = dictByPKey.get(key);
   } else {
     buff = null;
   }
   return (buff);
 }
 public CFDbTestOptFullRangeBuff lockDerived(
     CFSecurityAuthorization Authorization, CFDbTestOptFullRangePKey PKey) {
   final String S_ProcName = "CFDbTestRamOptFullRange.readDerived";
   CFDbTestOptFullRangePKey key = schema.getFactoryOptFullRange().newPKey();
   key.setRequiredId(PKey.getRequiredId());
   CFDbTestOptFullRangeBuff buff;
   if (dictByPKey.containsKey(key)) {
     buff = dictByPKey.get(key);
   } else {
     buff = null;
   }
   return (buff);
 }
 public CFDbTestNumberDefBuff readDerivedByUNameIdx(
     CFSecurityAuthorization Authorization, long TenantId, long ScopeId, String Name) {
   final String S_ProcName = "CFDbTestRamValue.readDerivedByUNameIdx";
   CFDbTestValueBuff buff =
       schema.getTableValue().readDerivedByUNameIdx(Authorization, TenantId, ScopeId, Name);
   if (buff == null) {
     return (null);
   } else if (buff instanceof CFDbTestNumberDefBuff) {
     return ((CFDbTestNumberDefBuff) buff);
   } else {
     return (null);
   }
 }
  public CFSecurityClusterBuff readDerivedByIdIdx(CFSecurityAuthorization Authorization, long Id) {
    final String S_ProcName = "CFDbTestRamCluster.readDerivedByIdIdx() ";
    CFSecurityClusterPKey key = schema.getFactoryCluster().newPKey();
    key.setRequiredId(Id);

    CFSecurityClusterBuff buff;
    if (dictByPKey.containsKey(key)) {
      buff = dictByPKey.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
  public void updateNumberDef(CFSecurityAuthorization Authorization, CFDbTestNumberDefBuff Buff) {
    schema.getTableAtom().updateAtom(Authorization, Buff);
    CFDbTestValuePKey pkey = schema.getFactoryValue().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFDbTestNumberDefBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newStaleCacheDetectedException(
              getClass(), "updateNumberDef", "Existing record not found", "NumberDef", pkey);
    }
    // Check unique indexes

    // Validate foreign keys

    {
      boolean allNull = true;

      if (allNull) {
        if (null
            == schema
                .getTableAtom()
                .readDerivedByIdIdx(
                    Authorization, Buff.getRequiredTenantId(), Buff.getRequiredId())) {
          throw CFLib.getDefaultExceptionFactory()
              .newUnresolvedRelationException(
                  getClass(), "updateNumberDef", "Superclass", "SuperClass", "Atom", null);
        }
      }
    }

    // Update is valid

    Map<CFDbTestValuePKey, CFDbTestNumberDefBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);
  }
  public CFSecurityClusterBuff readDerivedByUDescrIdx(
      CFSecurityAuthorization Authorization, String Description) {
    final String S_ProcName = "CFDbTestRamCluster.readDerivedByUDescrIdx";
    CFSecurityClusterByUDescrIdxKey key = schema.getFactoryCluster().newUDescrIdxKey();
    key.setRequiredDescription(Description);

    CFSecurityClusterBuff buff;
    if (dictByUDescrIdx.containsKey(key)) {
      buff = dictByUDescrIdx.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
  public CFDbTestLoaderBehaviourBuff readDerivedByUNameIdx(
      CFSecurityAuthorization Authorization, String Name) {
    final String S_ProcName = "CFDbTestRamLoaderBehaviour.readDerivedByUNameIdx";
    CFDbTestLoaderBehaviourByUNameIdxKey key = schema.getFactoryLoaderBehaviour().newUNameIdxKey();
    key.setRequiredName(Name);

    CFDbTestLoaderBehaviourBuff buff;
    if (dictByUNameIdx.containsKey(key)) {
      buff = dictByUNameIdx.get(key);
    } else {
      buff = null;
    }
    return (buff);
  }
 public CFDbTestReqMinMaxValueBuff readDerived(
     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 createNumberDef(CFSecurityAuthorization Authorization, CFDbTestNumberDefBuff Buff) {
    final String S_ProcName = "createNumberDef";
    schema.getTableAtom().createAtom(Authorization, Buff);
    CFDbTestValuePKey pkey = schema.getFactoryValue().newPKey();
    pkey.setClassCode(Buff.getClassCode());
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
      throw CFLib.getDefaultExceptionFactory()
          .newPrimaryKeyNotNewException(getClass(), S_ProcName, pkey);
    }

    // Validate foreign keys

    {
      boolean allNull = true;
      allNull = false;
      allNull = false;
      if (!allNull) {
        if (null
            == schema
                .getTableAtom()
                .readDerivedByIdIdx(
                    Authorization, Buff.getRequiredTenantId(), Buff.getRequiredId())) {
          throw CFLib.getDefaultExceptionFactory()
              .newUnresolvedRelationException(
                  getClass(), S_ProcName, "Superclass", "SuperClass", "Atom", null);
        }
      }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);
  }
  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 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 CFSecurityCursor openOptFullRangeCursorByTenantIdx(
      CFSecurityAuthorization Authorization, long TenantId) {
    CFSecurityCursor cursor;
    CFDbTestOptFullRangeByTenantIdxKey key = schema.getFactoryOptFullRange().newTenantIdxKey();
    key.setRequiredTenantId(TenantId);

    if (dictByTenantIdx.containsKey(key)) {
      Map<CFDbTestOptFullRangePKey, CFDbTestOptFullRangeBuff> subdictTenantIdx =
          dictByTenantIdx.get(key);
      cursor = new CFDbTestRamOptFullRangeCursor(Authorization, schema, subdictTenantIdx.values());
    } else {
      cursor =
          new CFDbTestRamOptFullRangeCursor(
              Authorization, schema, new ArrayList<CFDbTestOptFullRangeBuff>());
    }
    return (cursor);
  }
 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 void deleteCluster(CFSecurityAuthorization Authorization, CFSecurityClusterBuff Buff) {
    final String S_ProcName = "CFDbTestRamClusterTable.deleteCluster() ";
    CFSecurityClusterPKey pkey = schema.getFactoryCluster().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    CFSecurityClusterBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      return;
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "deleteCluster", pkey);
    }
    CFSecurityClusterByUDomainNameIdxKey keyUDomainNameIdx =
        schema.getFactoryCluster().newUDomainNameIdxKey();
    keyUDomainNameIdx.setRequiredFullDomainName(existing.getRequiredFullDomainName());

    CFSecurityClusterByUDescrIdxKey keyUDescrIdx = schema.getFactoryCluster().newUDescrIdxKey();
    keyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableHostNode().deleteHostNodeByClusterIdx(Authorization, Buff.getRequiredId());
    schema.getTableTenant().deleteTenantByClusterIdx(Authorization, Buff.getRequiredId());
    schema.getTableSecApp().deleteSecAppByClusterIdx(Authorization, Buff.getRequiredId());
    schema.getTableSecGroup().deleteSecGroupByClusterIdx(Authorization, Buff.getRequiredId());
    schema.getTableSysCluster().deleteSysClusterByClusterIdx(Authorization, Buff.getRequiredId());
    Map<CFSecurityClusterPKey, CFSecurityClusterBuff> subdict;

    dictByPKey.remove(pkey);

    dictByUDomainNameIdx.remove(keyUDomainNameIdx);

    dictByUDescrIdx.remove(keyUDescrIdx);
  }
  public CFDbTestReqMinMaxValueBuff[] readDerivedByTenantIdx(
      CFSecurityAuthorization Authorization, long TenantId) {
    final String S_ProcName = "CFDbTestRamReqMinMaxValue.readDerivedByTenantIdx";
    CFDbTestReqMinMaxValueByTenantIdxKey key = schema.getFactoryReqMinMaxValue().newTenantIdxKey();
    key.setRequiredTenantId(TenantId);

    CFDbTestReqMinMaxValueBuff[] recArray;
    if (dictByTenantIdx.containsKey(key)) {
      Map<CFDbTestReqMinMaxValuePKey, CFDbTestReqMinMaxValueBuff> subdictTenantIdx =
          dictByTenantIdx.get(key);
      recArray = new CFDbTestReqMinMaxValueBuff[subdictTenantIdx.size()];
      Iterator<CFDbTestReqMinMaxValueBuff> iter = subdictTenantIdx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFDbTestReqMinMaxValuePKey, CFDbTestReqMinMaxValueBuff> subdictTenantIdx =
          new HashMap<CFDbTestReqMinMaxValuePKey, CFDbTestReqMinMaxValueBuff>();
      dictByTenantIdx.put(key, subdictTenantIdx);
      recArray = new CFDbTestReqMinMaxValueBuff[0];
    }
    return (recArray);
  }
  public void updateReqMinMaxValue(
      CFSecurityAuthorization Authorization, CFDbTestReqMinMaxValueBuff Buff) {
    CFDbTestReqMinMaxValuePKey pkey = schema.getFactoryReqMinMaxValue().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFDbTestReqMinMaxValueBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newStaleCacheDetectedException(
              getClass(),
              "updateReqMinMaxValue",
              "Existing record not found",
              "ReqMinMaxValue",
              pkey);
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
      throw CFLib.getDefaultExceptionFactory()
          .newCollisionDetectedException(getClass(), "updateReqMinMaxValue", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFDbTestReqMinMaxValueByUDescrIdxKey existingKeyUDescrIdx =
        schema.getFactoryReqMinMaxValue().newUDescrIdxKey();
    existingKeyUDescrIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    CFDbTestReqMinMaxValueByUDescrIdxKey newKeyUDescrIdx =
        schema.getFactoryReqMinMaxValue().newUDescrIdxKey();
    newKeyUDescrIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyUDescrIdx.setRequiredDescription(Buff.getRequiredDescription());

    CFDbTestReqMinMaxValueByTenantIdxKey existingKeyTenantIdx =
        schema.getFactoryReqMinMaxValue().newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFDbTestReqMinMaxValueByTenantIdxKey newKeyTenantIdx =
        schema.getFactoryReqMinMaxValue().newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    // Check unique indexes

    if (!existingKeyUDescrIdx.equals(newKeyUDescrIdx)) {
      if (dictByUDescrIdx.containsKey(newKeyUDescrIdx)) {
        throw CFLib.getDefaultExceptionFactory()
            .newUniqueIndexViolationException(
                getClass(), "updateReqMinMaxValue", "ReqMinMaxValueUDescrIdx", newKeyUDescrIdx);
      }
    }

    // Validate foreign keys

    {
      boolean allNull = true;

      if (allNull) {
        if (null
            == schema
                .getTableTenant()
                .readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
          throw CFLib.getDefaultExceptionFactory()
              .newUnresolvedRelationException(
                  getClass(), "updateReqMinMaxValue", "Container", "Tenant", "Tenant", null);
        }
      }
    }

    // Update is valid

    Map<CFDbTestReqMinMaxValuePKey, CFDbTestReqMinMaxValueBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    dictByUDescrIdx.remove(existingKeyUDescrIdx);
    dictByUDescrIdx.put(newKeyUDescrIdx, Buff);

    subdict = dictByTenantIdx.get(existingKeyTenantIdx);
    if (subdict != null) {
      subdict.remove(pkey);
    }
    if (dictByTenantIdx.containsKey(newKeyTenantIdx)) {
      subdict = dictByTenantIdx.get(newKeyTenantIdx);
    } else {
      subdict = new HashMap<CFDbTestReqMinMaxValuePKey, CFDbTestReqMinMaxValueBuff>();
      dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);
  }
 public void deleteClusterByUDescrIdx(
     CFSecurityAuthorization Authorization, String argDescription) {
   CFSecurityClusterByUDescrIdxKey key = schema.getFactoryCluster().newUDescrIdxKey();
   key.setRequiredDescription(argDescription);
   deleteClusterByUDescrIdx(Authorization, key);
 }
 public void deleteClusterByUDomainNameIdx(
     CFSecurityAuthorization Authorization, String argFullDomainName) {
   CFSecurityClusterByUDomainNameIdxKey key = schema.getFactoryCluster().newUDomainNameIdxKey();
   key.setRequiredFullDomainName(argFullDomainName);
   deleteClusterByUDomainNameIdx(Authorization, key);
 }