public void setServiceBuff(CFSecurityServiceHBuff src) {
   setRequiredClusterId(src.getRequiredClusterId());
   setRequiredServiceId(src.getRequiredServiceId());
   setRequiredHostNodeId(src.getRequiredHostNodeId());
   setRequiredServiceTypeId(src.getRequiredServiceTypeId());
   setRequiredHostPort(src.getRequiredHostPort());
 }
 public void setServiceBuff(CFSecurityServiceBuff src) {
   setRequiredClusterId(src.getRequiredClusterId());
   setRequiredServiceId(src.getRequiredServiceId());
   setCreatedByUserId(src.getCreatedByUserId());
   setCreatedAt(src.getCreatedAt());
   setUpdatedByUserId(src.getUpdatedByUserId());
   setUpdatedAt(src.getUpdatedAt());
   setRequiredHostNodeId(src.getRequiredHostNodeId());
   setRequiredServiceTypeId(src.getRequiredServiceTypeId());
   setRequiredHostPort(src.getRequiredHostPort());
   setRequiredRevision(src.getRequiredRevision());
 }
  public void createService(CFSecurityAuthorization Authorization, CFSecurityServiceBuff Buff) {
    final String S_ProcName = "createService";
    CFSecurityServicePKey pkey = schema.getFactoryService().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredServiceId(
        ((CFBamRamClusterTable) schema.getTableCluster())
            .nextServiceIdGen(Authorization, Buff.getRequiredClusterId()));
    Buff.setRequiredClusterId(pkey.getRequiredClusterId());
    Buff.setRequiredServiceId(pkey.getRequiredServiceId());
    CFSecurityServiceByClusterIdxKey keyClusterIdx = schema.getFactoryService().newClusterIdxKey();
    keyClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId());

    CFSecurityServiceByHostIdxKey keyHostIdx = schema.getFactoryService().newHostIdxKey();
    keyHostIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    keyHostIdx.setRequiredHostNodeId(Buff.getRequiredHostNodeId());

    CFSecurityServiceByTypeIdxKey keyTypeIdx = schema.getFactoryService().newTypeIdxKey();
    keyTypeIdx.setRequiredServiceTypeId(Buff.getRequiredServiceTypeId());

    CFSecurityServiceByUTypeIdxKey keyUTypeIdx = schema.getFactoryService().newUTypeIdxKey();
    keyUTypeIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    keyUTypeIdx.setRequiredHostNodeId(Buff.getRequiredHostNodeId());
    keyUTypeIdx.setRequiredServiceTypeId(Buff.getRequiredServiceTypeId());

    CFSecurityServiceByUHostPortIdxKey keyUHostPortIdx =
        schema.getFactoryService().newUHostPortIdxKey();
    keyUHostPortIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    keyUHostPortIdx.setRequiredHostNodeId(Buff.getRequiredHostNodeId());
    keyUHostPortIdx.setRequiredHostPort(Buff.getRequiredHostPort());

    // Validate unique indexes

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

    if (dictByUTypeIdx.containsKey(keyUTypeIdx)) {
      throw CFLib.getDefaultExceptionFactory()
          .newUniqueIndexViolationException(getClass(), S_ProcName, "ServiceUTypeIdx", keyUTypeIdx);
    }

    if (dictByUHostPortIdx.containsKey(keyUHostPortIdx)) {
      throw CFLib.getDefaultExceptionFactory()
          .newUniqueIndexViolationException(
              getClass(), S_ProcName, "ServiceUHostPort", keyUHostPortIdx);
    }

    // Validate foreign keys

    {
      boolean allNull = true;
      allNull = false;
      if (!allNull) {
        if (null
            == schema
                .getTableCluster()
                .readDerivedByIdIdx(Authorization, Buff.getRequiredClusterId())) {
          throw CFLib.getDefaultExceptionFactory()
              .newUnresolvedRelationException(
                  getClass(), S_ProcName, "Owner", "ServiceCluster", "Cluster", null);
        }
      }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    Map<CFSecurityServicePKey, CFSecurityServiceBuff> subdictClusterIdx;
    if (dictByClusterIdx.containsKey(keyClusterIdx)) {
      subdictClusterIdx = dictByClusterIdx.get(keyClusterIdx);
    } else {
      subdictClusterIdx = new HashMap<CFSecurityServicePKey, CFSecurityServiceBuff>();
      dictByClusterIdx.put(keyClusterIdx, subdictClusterIdx);
    }
    subdictClusterIdx.put(pkey, Buff);

    Map<CFSecurityServicePKey, CFSecurityServiceBuff> subdictHostIdx;
    if (dictByHostIdx.containsKey(keyHostIdx)) {
      subdictHostIdx = dictByHostIdx.get(keyHostIdx);
    } else {
      subdictHostIdx = new HashMap<CFSecurityServicePKey, CFSecurityServiceBuff>();
      dictByHostIdx.put(keyHostIdx, subdictHostIdx);
    }
    subdictHostIdx.put(pkey, Buff);

    Map<CFSecurityServicePKey, CFSecurityServiceBuff> subdictTypeIdx;
    if (dictByTypeIdx.containsKey(keyTypeIdx)) {
      subdictTypeIdx = dictByTypeIdx.get(keyTypeIdx);
    } else {
      subdictTypeIdx = new HashMap<CFSecurityServicePKey, CFSecurityServiceBuff>();
      dictByTypeIdx.put(keyTypeIdx, subdictTypeIdx);
    }
    subdictTypeIdx.put(pkey, Buff);

    dictByUTypeIdx.put(keyUTypeIdx, Buff);

    dictByUHostPortIdx.put(keyUHostPortIdx, Buff);
  }