public ICFSecuritySecGroupObj readSecGroupByUNameIdx(
     long ClusterId, String Name, boolean forceRead) {
   if (indexByUNameIdx == null) {
     indexByUNameIdx = new HashMap<CFSecuritySecGroupByUNameIdxKey, ICFSecuritySecGroupObj>();
   }
   CFSecuritySecGroupByUNameIdxKey key =
       ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey();
   key.setRequiredClusterId(ClusterId);
   key.setRequiredName(Name);
   ICFSecuritySecGroupObj obj = null;
   if ((!forceRead) && indexByUNameIdx.containsKey(key)) {
     obj = indexByUNameIdx.get(key);
   } else {
     CFSecuritySecGroupBuff buff =
         ((ICFSecuritySchema) schema.getBackingStore())
             .getTableSecGroup()
             .readDerivedByUNameIdx(schema.getAuthorization(), ClusterId, Name);
     if (buff != null) {
       obj = schema.getSecGroupTableObj().newInstance();
       obj.setPKey(((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newPKey());
       obj.setBuff(buff);
       obj = (ICFSecuritySecGroupObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       indexByUNameIdx.put(key, null);
     }
   }
   return (obj);
 }
  public void forgetSecGroup(ICFSecuritySecGroupObj Obj, boolean forgetSubObjects) {
    ICFSecuritySecGroupObj obj = Obj;
    CFSecuritySecGroupPKey pkey = obj.getPKey();
    if (members.containsKey(pkey)) {
      ICFSecuritySecGroupObj keepObj = members.get(pkey);
      // Detach object from alternate, duplicate, all and PKey indexes

      if (indexByClusterIdx != null) {
        CFSecuritySecGroupByClusterIdxKey keyClusterIdx =
            ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newClusterIdxKey();
        keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId());
        Map<CFSecuritySecGroupPKey, ICFSecuritySecGroupObj> mapClusterIdx =
            indexByClusterIdx.get(keyClusterIdx);
        if (mapClusterIdx != null) {
          mapClusterIdx.remove(keepObj.getPKey());
        }
      }

      if (indexByUNameIdx != null) {
        CFSecuritySecGroupByUNameIdxKey keyUNameIdx =
            ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey();
        keyUNameIdx.setRequiredClusterId(keepObj.getRequiredClusterId());
        keyUNameIdx.setRequiredName(keepObj.getRequiredName());
        indexByUNameIdx.remove(keyUNameIdx);
      }

      if (allSecGroup != null) {
        allSecGroup.remove(keepObj.getPKey());
      }
      members.remove(pkey);
      if (forgetSubObjects) {
        ((ICFSecuritySchemaObj) schema)
            .getSecGroupIncludeTableObj()
            .forgetSecGroupIncludeByGroupIdx(
                keepObj.getRequiredClusterId(), keepObj.getRequiredSecGroupId());
        ((ICFSecuritySchemaObj) schema)
            .getSecGroupMemberTableObj()
            .forgetSecGroupMemberByGroupIdx(
                keepObj.getRequiredClusterId(), keepObj.getRequiredSecGroupId());
        ((ICFSecuritySchemaObj) schema)
            .getSecGroupIncludeTableObj()
            .forgetSecGroupIncludeByIncludeIdx(
                keepObj.getRequiredClusterId(), keepObj.getRequiredSecGroupId());
        ((ICFSecuritySchemaObj) schema)
            .getSecGroupFormTableObj()
            .forgetSecGroupFormByGroupIdx(
                keepObj.getRequiredClusterId(), keepObj.getRequiredSecGroupId());
      }
    }
  }
  public void forgetSecGroupByUNameIdx(long ClusterId, String Name) {
    if (indexByUNameIdx == null) {
      return;
    }
    CFSecuritySecGroupByUNameIdxKey key =
        ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey();
    key.setRequiredClusterId(ClusterId);
    key.setRequiredName(Name);
    if (indexByUNameIdx.containsKey(key)) {
      ICFSecuritySecGroupObj probed = indexByUNameIdx.get(key);
      if (probed != null) {
        probed.forget(true);
      }

      indexByUNameIdx.remove(key);
    }
  }
 public void deleteSecGroupByUNameIdx(long ClusterId, String Name) {
   if (indexByUNameIdx == null) {
     indexByUNameIdx = new HashMap<CFSecuritySecGroupByUNameIdxKey, ICFSecuritySecGroupObj>();
   }
   CFSecuritySecGroupByUNameIdxKey key =
       ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey();
   key.setRequiredClusterId(ClusterId);
   key.setRequiredName(Name);
   ICFSecuritySecGroupObj obj = null;
   if (indexByUNameIdx.containsKey(key)) {
     obj = indexByUNameIdx.get(key);
     ((ICFSecuritySchema) schema.getBackingStore())
         .getTableSecGroup()
         .deleteSecGroupByUNameIdx(schema.getAuthorization(), ClusterId, Name);
     obj.forget(true);
   } else {
     ((ICFSecuritySchema) schema.getBackingStore())
         .getTableSecGroup()
         .deleteSecGroupByUNameIdx(schema.getAuthorization(), ClusterId, Name);
   }
 }
 public void deleteSecGroupByUNameIdx(
     CFSecurityAuthorization Authorization, CFSecuritySecGroupByUNameIdxKey argKey) {
   deleteSecGroupByUNameIdx(
       Authorization, argKey.getRequiredClusterId(), argKey.getRequiredName());
 }
  public ICFSecuritySecGroupObj realizeSecGroup(ICFSecuritySecGroupObj Obj) {
    ICFSecuritySecGroupObj obj = Obj;
    CFSecuritySecGroupPKey pkey = obj.getPKey();
    ICFSecuritySecGroupObj keepObj = null;
    if (members.containsKey(pkey) && (null != members.get(pkey))) {
      ICFSecuritySecGroupObj existingObj = members.get(pkey);
      keepObj = existingObj;

      /*
       *	We always rebind the data because if we're being called, some index has
       *	been updated and is refreshing it's data, which may or may not have changed
       */

      // Detach object from alternate and duplicate indexes, leave PKey alone

      if (indexByClusterIdx != null) {
        CFSecuritySecGroupByClusterIdxKey keyClusterIdx =
            ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newClusterIdxKey();
        keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId());
        Map<CFSecuritySecGroupPKey, ICFSecuritySecGroupObj> mapClusterIdx =
            indexByClusterIdx.get(keyClusterIdx);
        if (mapClusterIdx != null) {
          mapClusterIdx.remove(keepObj.getPKey());
        }
      }

      if (indexByUNameIdx != null) {
        CFSecuritySecGroupByUNameIdxKey keyUNameIdx =
            ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey();
        keyUNameIdx.setRequiredClusterId(keepObj.getRequiredClusterId());
        keyUNameIdx.setRequiredName(keepObj.getRequiredName());
        indexByUNameIdx.remove(keyUNameIdx);
      }

      keepObj.setBuff(Obj.getBuff());
      // Attach new object to alternate and duplicate indexes -- PKey stay stable

      if (indexByClusterIdx != null) {
        CFSecuritySecGroupByClusterIdxKey keyClusterIdx =
            ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newClusterIdxKey();
        keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId());
        Map<CFSecuritySecGroupPKey, ICFSecuritySecGroupObj> mapClusterIdx =
            indexByClusterIdx.get(keyClusterIdx);
        if (mapClusterIdx != null) {
          mapClusterIdx.put(keepObj.getPKey(), keepObj);
        }
      }

      if (indexByUNameIdx != null) {
        CFSecuritySecGroupByUNameIdxKey keyUNameIdx =
            ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey();
        keyUNameIdx.setRequiredClusterId(keepObj.getRequiredClusterId());
        keyUNameIdx.setRequiredName(keepObj.getRequiredName());
        indexByUNameIdx.put(keyUNameIdx, keepObj);
      }
      if (allSecGroup != null) {
        allSecGroup.put(keepObj.getPKey(), keepObj);
      }
    } else {
      keepObj = obj;
      keepObj.setIsNew(false);
      // Attach new object to PKey, all, alternate, and duplicate indexes
      members.put(keepObj.getPKey(), keepObj);
      if (allSecGroup != null) {
        allSecGroup.put(keepObj.getPKey(), keepObj);
      }

      if (indexByClusterIdx != null) {
        CFSecuritySecGroupByClusterIdxKey keyClusterIdx =
            ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newClusterIdxKey();
        keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId());
        Map<CFSecuritySecGroupPKey, ICFSecuritySecGroupObj> mapClusterIdx =
            indexByClusterIdx.get(keyClusterIdx);
        if (mapClusterIdx != null) {
          mapClusterIdx.put(keepObj.getPKey(), keepObj);
        }
      }

      if (indexByUNameIdx != null) {
        CFSecuritySecGroupByUNameIdxKey keyUNameIdx =
            ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey();
        keyUNameIdx.setRequiredClusterId(keepObj.getRequiredClusterId());
        keyUNameIdx.setRequiredName(keepObj.getRequiredName());
        indexByUNameIdx.put(keyUNameIdx, keepObj);
      }
    }
    return (keepObj);
  }