public ICFBamDataScopeObj readDataScopeByUNameIdx(String Name, boolean forceRead) {
   if (indexByUNameIdx == null) {
     indexByUNameIdx = new HashMap<CFBamDataScopeByUNameIdxKey, ICFBamDataScopeObj>();
   }
   CFBamDataScopeByUNameIdxKey key =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey();
   key.setRequiredName(Name);
   ICFBamDataScopeObj obj = null;
   if ((!forceRead) && indexByUNameIdx.containsKey(key)) {
     obj = indexByUNameIdx.get(key);
   } else {
     CFBamDataScopeBuff buff =
         ((ICFBamSchema) schema.getBackingStore())
             .getTableDataScope()
             .readDerivedByUNameIdx(schema.getAuthorization(), Name);
     if (buff != null) {
       obj = schema.getDataScopeTableObj().newInstance();
       obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey());
       obj.setBuff(buff);
       obj = (ICFBamDataScopeObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       indexByUNameIdx.put(key, null);
     }
   }
   return (obj);
 }
  public ICFBamDataScopeObj realizeDataScope(ICFBamDataScopeObj Obj) {
    ICFBamDataScopeObj obj = Obj;
    CFBamDataScopePKey pkey = obj.getPKey();
    ICFBamDataScopeObj keepObj = null;
    if (members.containsKey(pkey) && (null != members.get(pkey))) {
      ICFBamDataScopeObj 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 (indexByUNameIdx != null) {
        CFBamDataScopeByUNameIdxKey keyUNameIdx =
            ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey();
        keyUNameIdx.setRequiredName(keepObj.getRequiredName());
        indexByUNameIdx.remove(keyUNameIdx);
      }

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

      if (indexByUNameIdx != null) {
        CFBamDataScopeByUNameIdxKey keyUNameIdx =
            ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey();
        keyUNameIdx.setRequiredName(keepObj.getRequiredName());
        indexByUNameIdx.put(keyUNameIdx, keepObj);
      }
      if (allDataScope != null) {
        allDataScope.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 (allDataScope != null) {
        allDataScope.put(keepObj.getPKey(), keepObj);
      }

      if (indexByUNameIdx != null) {
        CFBamDataScopeByUNameIdxKey keyUNameIdx =
            ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey();
        keyUNameIdx.setRequiredName(keepObj.getRequiredName());
        indexByUNameIdx.put(keyUNameIdx, keepObj);
      }
    }
    return (keepObj);
  }
 public ICFBamDataScopeObj readDataScopeByIdIdx(short Id, boolean forceRead) {
   CFBamDataScopePKey pkey =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey();
   pkey.setRequiredId(Id);
   ICFBamDataScopeObj obj = readDataScope(pkey, forceRead);
   return (obj);
 }
 public void deleteDataScopeByIdIdx(short Id) {
   CFBamDataScopePKey pkey =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey();
   pkey.setRequiredId(Id);
   ICFBamDataScopeObj obj = readDataScope(pkey);
   if (obj != null) {
     ICFBamDataScopeEditObj editObj = (ICFBamDataScopeEditObj) obj.getEdit();
     boolean editStarted;
     if (editObj == null) {
       editObj = (ICFBamDataScopeEditObj) obj.beginEdit();
       if (editObj != null) {
         editStarted = true;
       } else {
         editStarted = false;
       }
     } else {
       editStarted = false;
     }
     if (editObj != null) {
       editObj.delete();
       if (editStarted) {
         editObj.endEdit();
       }
     }
     obj.forget(true);
   }
 }
 public void deleteDataScope(ICFBamDataScopeObj Obj) {
   ICFBamDataScopeObj obj = Obj;
   ((ICFBamSchema) schema.getBackingStore())
       .getTableDataScope()
       .deleteDataScope(schema.getAuthorization(), obj.getDataScopeBuff());
   obj.forget(true);
 }
 public ICFBamDataScopeObj updateDataScope(ICFBamDataScopeObj Obj) {
   ICFBamDataScopeObj obj = Obj;
   ((ICFBamSchema) schema.getBackingStore())
       .getTableDataScope()
       .updateDataScope(schema.getAuthorization(), Obj.getDataScopeBuff());
   obj = (ICFBamDataScopeObj) Obj.realize();
   return (obj);
 }
 public ICFBamDataScopeObj lockDataScope(CFBamDataScopePKey pkey) {
   ICFBamDataScopeObj locked = null;
   CFBamDataScopeBuff lockBuff =
       ((ICFBamSchema) schema.getBackingStore())
           .getTableDataScope()
           .lockDerived(schema.getAuthorization(), pkey);
   if (lockBuff != null) {
     locked = schema.getDataScopeTableObj().newInstance();
     locked.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey());
     locked.setBuff(lockBuff);
     locked = (ICFBamDataScopeObj) locked.realize();
   } else {
     throw CFLib.getDefaultExceptionFactory()
         .newCollisionDetectedException(getClass(), "lockDataScope", pkey);
   }
   return (locked);
 }
 public ICFBamDataScopeObj createDataScope(ICFBamDataScopeObj Obj) {
   ICFBamDataScopeObj obj = Obj;
   CFBamDataScopeBuff buff = obj.getDataScopeBuff();
   ((ICFBamSchema) schema.getBackingStore())
       .getTableDataScope()
       .createDataScope(schema.getAuthorization(), buff);
   obj.copyBuffToPKey();
   obj = obj.realize();
   return (obj);
 }
 public void deleteDataScopeByUNameIdx(String Name) {
   if (indexByUNameIdx == null) {
     indexByUNameIdx = new HashMap<CFBamDataScopeByUNameIdxKey, ICFBamDataScopeObj>();
   }
   CFBamDataScopeByUNameIdxKey key =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey();
   key.setRequiredName(Name);
   ICFBamDataScopeObj obj = null;
   if (indexByUNameIdx.containsKey(key)) {
     obj = indexByUNameIdx.get(key);
     ((ICFBamSchema) schema.getBackingStore())
         .getTableDataScope()
         .deleteDataScopeByUNameIdx(schema.getAuthorization(), Name);
     obj.forget(true);
   } else {
     ((ICFBamSchema) schema.getBackingStore())
         .getTableDataScope()
         .deleteDataScopeByUNameIdx(schema.getAuthorization(), Name);
   }
 }
 public ICFBamDataScopeObj readDataScope(CFBamDataScopePKey pkey, boolean forceRead) {
   ICFBamDataScopeObj obj = null;
   if ((!forceRead) && members.containsKey(pkey)) {
     obj = members.get(pkey);
   } else {
     CFBamDataScopeBuff readBuff =
         ((ICFBamSchema) schema.getBackingStore())
             .getTableDataScope()
             .readDerivedByIdIdx(schema.getAuthorization(), pkey.getRequiredId());
     if (readBuff != null) {
       obj = schema.getDataScopeTableObj().newInstance();
       obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey());
       obj.setBuff(readBuff);
       obj = (ICFBamDataScopeObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       members.put(pkey, null);
     }
   }
   return (obj);
 }
 public void forgetDataScopeByIdIdx(short Id) {
   if (members == null) {
     return;
   }
   CFBamDataScopePKey key =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey();
   key.setRequiredId(Id);
   if (members.containsKey(key)) {
     ICFBamDataScopeObj probed = members.get(key);
     if (probed != null) {
       probed.forget(true);
     }
   }
 }
  public void forgetDataScopeByUNameIdx(String Name) {
    if (indexByUNameIdx == null) {
      return;
    }
    CFBamDataScopeByUNameIdxKey key =
        ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey();
    key.setRequiredName(Name);
    if (indexByUNameIdx.containsKey(key)) {
      ICFBamDataScopeObj probed = indexByUNameIdx.get(key);
      if (probed != null) {
        probed.forget(true);
      }

      indexByUNameIdx.remove(key);
    }
  }
  public void forgetDataScope(ICFBamDataScopeObj Obj, boolean forgetSubObjects) {
    ICFBamDataScopeObj obj = Obj;
    CFBamDataScopePKey pkey = obj.getPKey();
    if (members.containsKey(pkey)) {
      ICFBamDataScopeObj keepObj = members.get(pkey);
      // Detach object from alternate, duplicate, all and PKey indexes

      if (indexByUNameIdx != null) {
        CFBamDataScopeByUNameIdxKey keyUNameIdx =
            ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey();
        keyUNameIdx.setRequiredName(keepObj.getRequiredName());
        indexByUNameIdx.remove(keyUNameIdx);
      }

      if (allDataScope != null) {
        allDataScope.remove(keepObj.getPKey());
      }
      members.remove(pkey);
      if (forgetSubObjects) {}
    }
  }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFBamXMsgSchemaMessageFormatter schemaFormatter = null;
    try {
      // Common XML Attributes
      String attrId = null;
      // Primary Key Attributes for Constant Enum support
      String attrTenantId = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstClearSubDep1Lock");

      CFBamXMsgRqstHandler xmsgRqstHandler = (CFBamXMsgRqstHandler) getParser();
      if (xmsgRqstHandler == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()");
      }

      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();

      ICFBamSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
      if (schemaObj == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()");
      }

      // Instantiate a PKey buffer for the parsed information
      CFBamScopePKey pkey =
          ((ICFBamSchema) schemaObj.getBackingStore()).getFactoryScope().newPKey();

      // Extract Attributes
      numAttrs = attrs.getLength();
      for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
        attrLocalName = attrs.getLocalName(idxAttr);
        if (attrLocalName.equals("Id")) {
          if (attrId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("TenantId")) {
          if (attrTenantId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrTenantId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("schemaLocation")) {
          // ignored
        } else {
          throw CFLib.getDefaultExceptionFactory()
              .newUnrecognizedAttributeException(
                  getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName);
        }
      }

      // Ensure that required attributes have values
      if ((attrTenantId == null) || (attrTenantId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "TenantId");
      }
      if ((attrId == null) || (attrId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "Id");
      }

      // Get current context
      CFLibXmlCoreContext curContext = getParser().getCurContext();
      // Convert string attributes to native Java types
      // and apply the converted attributes to the editBuff.

      long natTenantId;
      natTenantId = Long.parseLong(attrTenantId);
      pkey.setRequiredTenantId(natTenantId);

      pkey.setRequiredTenantId(natTenantId);
      long natId;
      natId = Long.parseLong(attrId);
      pkey.setRequiredId(natId);

      pkey.setRequiredId(natId);
      // Lock the object
      ICFBamClearSubDep1Obj locked =
          ((ICFBamClearSubDep1Obj) schemaObj.getClearSubDep1TableObj().lockClearSubDep1(pkey));
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgClearSubDep1MessageFormatter.formatClearSubDep1RspnLocked(
                  "\n\t\t\t", locked.getClearSubDep1Buff())
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      ((CFBamXMsgRqstHandler) getParser()).appendResponse(response);
    } catch (RuntimeException e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    }
  }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFBamXMsgSchemaMessageFormatter schemaFormatter = null;
    try {
      // Common XML Attributes
      String attrId = null;
      String attrRevision = null;
      // Primary Key Attributes for Constant Enum support
      String attrTenantId = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstInt16DefDelete");

      CFBamXMsgRqstHandler xmsgRqstHandler = (CFBamXMsgRqstHandler) getParser();
      if (xmsgRqstHandler == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()");
      }

      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();

      ICFBamSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
      if (schemaObj == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()");
      }

      // Instantiate a PKey buffer for the parsed information
      CFBamValuePKey pkey =
          ((ICFBamSchema) schemaObj.getBackingStore()).getFactoryValue().newPKey();

      // Extract Attributes
      numAttrs = attrs.getLength();
      for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
        attrLocalName = attrs.getLocalName(idxAttr);
        if (attrLocalName.equals("Id")) {
          if (attrId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("Revision")) {
          if (attrRevision != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrRevision = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("TenantId")) {
          if (attrTenantId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrTenantId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("schemaLocation")) {
          // ignored
        } else {
          throw CFLib.getDefaultExceptionFactory()
              .newUnrecognizedAttributeException(
                  getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName);
        }
      }

      // Ensure that required attributes have values
      if ((attrTenantId == null) || (attrTenantId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "TenantId");
      }
      if ((attrId == null) || (attrId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "Id");
      }
      if ((attrRevision == null) || (attrRevision.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "Revision");
      }

      // Get current context
      CFLibXmlCoreContext curContext = getParser().getCurContext();
      // Convert string attributes to native Java types
      // and apply the converted attributes to the editBuff.

      long natTenantId;
      natTenantId = Long.parseLong(attrTenantId);
      pkey.setRequiredTenantId(natTenantId);

      pkey.setRequiredTenantId(natTenantId);
      long natId;
      natId = Long.parseLong(attrId);
      pkey.setRequiredId(natId);

      pkey.setRequiredId(natId);
      int natRevision = Integer.parseInt(attrRevision);
      // Delete the object
      ICFBamInt16DefObj read =
          ((ICFBamInt16DefObj) schemaObj.getInt16DefTableObj().readInt16Def(pkey));
      if (read != null) {
        if (read.getInt16DefBuff().getRequiredRevision() > natRevision) {
          throw CFLib.getDefaultExceptionFactory()
              .newCollisionDetectedException(
                  getClass(), S_ProcName, "Collision detected preparing to delete Int16Def");
        } else {
          ICFBamInt16DefEditObj editBuff = (ICFBamInt16DefEditObj) read.beginEdit();
          if (editBuff != null) {
            editBuff.delete();
            editBuff.endEdit();
            String response =
                schemaFormatter.formatRspnXmlPreamble()
                    + "\n"
                    + "\t"
                    + CFBamXMsgInt16DefMessageFormatter.formatInt16DefRspnDeleted()
                    + "\n"
                    + schemaFormatter.formatRspnXmlPostamble();
            ((CFBamXMsgRqstHandler) getParser()).appendResponse(response);
          } else {
            throw CFLib.getDefaultExceptionFactory()
                .newNullArgumentException(getClass(), S_ProcName, 0, "read.beginEdit()");
          }
        }
      } else {
        String response =
            schemaFormatter.formatRspnXmlPreamble()
                + "\n"
                + "\t"
                + CFBamXMsgSchemaMessageFormatter.formatRspnNoDataFound()
                + "\n"
                + schemaFormatter.formatRspnXmlPostamble();
        ((CFBamXMsgRqstHandler) getParser()).appendResponse(response);
      }
    } catch (RuntimeException e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    }
  }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFBamXMsgSchemaMessageFormatter schemaFormatter = null;
    try {
      // Common XML Attributes
      String attrId = null;
      // Primary Key Attributes for Constant Enum support
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstISOCountryRead");

      CFBamXMsgRqstHandler xmsgRqstHandler = (CFBamXMsgRqstHandler) getParser();
      if (xmsgRqstHandler == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()");
      }

      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();

      ICFBamSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
      if (schemaObj == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()");
      }

      // Instantiate a PKey buffer for the parsed information
      CFSecurityISOCountryPKey pkey =
          ((ICFBamSchema) schemaObj.getBackingStore()).getFactoryISOCountry().newPKey();

      // Extract Attributes
      numAttrs = attrs.getLength();
      for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
        attrLocalName = attrs.getLocalName(idxAttr);
        if (attrLocalName.equals("Id")) {
          if (attrId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("schemaLocation")) {
          // ignored
        } else {
          throw CFLib.getDefaultExceptionFactory()
              .newUnrecognizedAttributeException(
                  getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName);
        }
      }

      // Ensure that required attributes have values
      if ((attrId == null) || (attrId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "Id");
      }

      // Get current context
      CFLibXmlCoreContext curContext = getParser().getCurContext();
      // Convert string attributes to native Java types
      // and apply the converted attributes to the editBuff.

      short natId;
      natId = Short.parseShort(attrId);
      pkey.setRequiredId(natId);

      pkey.setRequiredId(natId);
      // Read the object and prepare the XML response
      ICFBamISOCountryObj read =
          ((ICFBamISOCountryObj) schemaObj.getISOCountryTableObj().readISOCountry(pkey, true));
      if (read != null) {
        String response =
            schemaFormatter.formatRspnXmlPreamble()
                + "\n"
                + "\t"
                + CFBamXMsgISOCountryMessageFormatter.formatISOCountryRspnSingleOpenTag()
                + CFBamXMsgISOCountryMessageFormatter.formatISOCountryRspnDerivedRec(
                    "\n\t\t", read.getISOCountryBuff())
                + "\n"
                + "\t"
                + CFBamXMsgISOCountryMessageFormatter.formatISOCountryRspnSingleCloseTag()
                + schemaFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(response);
      } else {
        String response =
            schemaFormatter.formatRspnXmlPreamble()
                + "\n"
                + "\t"
                + CFBamXMsgSchemaMessageFormatter.formatRspnNoDataFound()
                + "\n"
                + schemaFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(response);
      }
    } catch (RuntimeException e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    }
  }
 public List<ICFBamDataScopeObj> readAllDataScope(boolean forceRead) {
   final String S_ProcName = "readAllDataScope";
   if ((allDataScope == null) || forceRead) {
     Map<CFBamDataScopePKey, ICFBamDataScopeObj> map =
         new HashMap<CFBamDataScopePKey, ICFBamDataScopeObj>();
     allDataScope = map;
     CFBamDataScopeBuff[] buffList =
         ((ICFBamSchema) schema.getBackingStore())
             .getTableDataScope()
             .readAllDerived(schema.getAuthorization());
     CFBamDataScopeBuff buff;
     ICFBamDataScopeObj obj;
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       obj = newInstance();
       obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey());
       obj.setBuff(buff);
       ICFBamDataScopeObj realized = (ICFBamDataScopeObj) obj.realize();
     }
   }
   Comparator<ICFBamDataScopeObj> cmp =
       new Comparator<ICFBamDataScopeObj>() {
         public int compare(ICFBamDataScopeObj lhs, ICFBamDataScopeObj rhs) {
           if (lhs == null) {
             if (rhs == null) {
               return (0);
             } else {
               return (-1);
             }
           } else if (rhs == null) {
             return (1);
           } else {
             CFBamDataScopePKey lhsPKey = lhs.getPKey();
             CFBamDataScopePKey rhsPKey = rhs.getPKey();
             int ret = lhsPKey.compareTo(rhsPKey);
             return (ret);
           }
         }
       };
   int len = allDataScope.size();
   ICFBamDataScopeObj arr[] = new ICFBamDataScopeObj[len];
   Iterator<ICFBamDataScopeObj> valIter = allDataScope.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<ICFBamDataScopeObj> arrayList = new ArrayList<ICFBamDataScopeObj>(len);
   for (idx = 0; idx < len; idx++) {
     arrayList.add(arr[idx]);
   }
   List<ICFBamDataScopeObj> sortedList = arrayList;
   return (sortedList);
 }