public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    try {
      // Common XML Attributes
      String attrId = null;
      // Scope Attributes
      // Scope References
      ICFBamTenantObj refTenant = null;
      // DelDep Attributes
      String attrRelation = null;
      String attrDefSchema = null;
      // DelDep References
      ICFBamRelationObj refRelation = null;
      ICFBamSchemaDefObj refDefSchema = null;
      // DelSubDep2 Attributes
      String attrName = null;
      // DelSubDep2 References
      ICFBamDelSubDep1Obj refContDelSubDep1 = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("DelSubDep2");

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

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

      // Instantiate an edit buffer for the parsed information
      ICFBamDelSubDep2EditObj editBuff =
          (ICFBamDelSubDep2EditObj) schemaObj.getDelSubDep2TableObj().newInstance().beginEdit();

      // 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("Relation")) {
          if (attrRelation != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrRelation = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("DefSchema")) {
          if (attrDefSchema != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrDefSchema = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("Name")) {
          if (attrName != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrName = 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 ((attrRelation == null) || (attrRelation.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "Relation");
      }
      if (attrName == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "Name");
      }

      // Save named attributes to context
      CFLibXmlCoreContext curContext = getParser().getCurContext();
      curContext.putNamedValue("Id", attrId);
      curContext.putNamedValue("Relation", attrRelation);
      curContext.putNamedValue("DefSchema", attrDefSchema);
      curContext.putNamedValue("Name", attrName);

      // Convert string attributes to native Java types
      // and apply the converted attributes to the editBuff.

      Integer natId;
      if ((attrId != null) && (attrId.length() > 0)) {
        natId = new Integer(Integer.parseInt(attrId));
      } else {
        natId = null;
      }
      String natName = attrName;
      editBuff.setRequiredName(natName);

      // Get the scope/container object

      CFLibXmlCoreContext parentContext = curContext.getPrevContext();
      Object scopeObj;
      if (parentContext != null) {
        scopeObj = parentContext.getNamedValue("Object");
      } else {
        scopeObj = null;
      }

      // Resolve and apply required Container reference

      if (scopeObj == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "scopeObj");
      } else if (scopeObj instanceof ICFBamDelSubDep1Obj) {
        refContDelSubDep1 = (ICFBamDelSubDep1Obj) scopeObj;
        editBuff.setRequiredContainerContDelSubDep1(refContDelSubDep1);
        refTenant = (ICFBamTenantObj) editBuff.getRequiredOwnerTenant();
      } else {
        throw CFLib.getDefaultExceptionFactory()
            .newUnsupportedClassException(
                getClass(), S_ProcName, "scopeObj", scopeObj, "ICFBamDelSubDep1Obj");
      }

      // Resolve and apply Owner reference

      if (refTenant == null) {
        if (scopeObj instanceof ICFBamTenantObj) {
          refTenant = (ICFBamTenantObj) scopeObj;
          editBuff.setRequiredOwnerTenant(refTenant);
        } else {
          throw CFLib.getDefaultExceptionFactory()
              .newNullArgumentException(getClass(), S_ProcName, 0, "Owner<Tenant>");
        }
      }

      // Lookup refRelation by qualified name
      if ((attrRelation != null) && (attrRelation.length() > 0)) {
        refRelation =
            (ICFBamRelationObj)
                (editBuff.getNamedObject(
                    schemaObj.getRelationTableObj().getObjQualifyingClass(), attrRelation));
        if (refRelation == null) {
          throw CFLib.getDefaultExceptionFactory()
              .newNullArgumentException(
                  getClass(),
                  S_ProcName,
                  0,
                  "Resolve Relation reference qualified name \""
                      + attrRelation
                      + "\" to table Relation");
        }
      } else {
        refRelation = null;
      }
      editBuff.setRequiredLookupRelation(refRelation);

      // Lookup refDefSchema by qualified name
      if ((attrDefSchema != null) && (attrDefSchema.length() > 0)) {
        refDefSchema =
            (ICFBamSchemaDefObj)
                (editBuff.getNamedObject(
                    schemaObj.getSchemaDefTableObj().getObjQualifyingClass(), attrDefSchema));
        if (refDefSchema == null) {
          throw CFLib.getDefaultExceptionFactory()
              .newNullArgumentException(
                  getClass(),
                  S_ProcName,
                  0,
                  "Resolve DefSchema reference qualified name \""
                      + attrDefSchema
                      + "\" to table SchemaDef");
        }
      } else {
        refDefSchema = null;
      }
      editBuff.setOptionalLookupDefSchema(refDefSchema);

      ICFBamDelSubDep2Obj origDelSubDep2;
      ICFBamDelSubDep2EditObj editDelSubDep2 = editBuff;
      origDelSubDep2 = (ICFBamDelSubDep2Obj) editDelSubDep2.create();
      editDelSubDep2.endEdit();

      curContext.putNamedValue("Object", origDelSubDep2);
    } catch (RuntimeException e) {
      throw new RuntimeException(
          "Near "
              + getParser().getLocationInfo()
              + ": Caught and rethrew "
              + e.getClass().getName()
              + " - "
              + e.getMessage(),
          e);
    } catch (Error e) {
      throw new Error(
          "Near "
              + getParser().getLocationInfo()
              + ": Caught and rethrew "
              + e.getClass().getName()
              + " - "
              + e.getMessage(),
          e);
    }
  }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFBamXMsgSchemaMessageFormatter schemaFormatter = null;
    try {
      // Common XML Attributes
      String attrId = null;
      String attrRelationTypeId = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstRelationDeleteByRTypeKeyIdx");

      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()");
      }

      // 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("RelationTypeId")) {
          if (attrRelationTypeId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrRelationTypeId = 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 ((attrRelationTypeId == null) || (attrRelationTypeId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "RelationTypeId");
      }

      // Save named attributes to context
      CFLibXmlCoreContext curContext = getParser().getCurContext();
      // Convert string attributes to native Java types

      short natRelationTypeId;
      natRelationTypeId = Short.parseShort(attrRelationTypeId);

      // Delete the objects
      schemaObj.getRelationTableObj().deleteRelationByRTypeKeyIdx(natRelationTypeId);
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgRelationMessageFormatter.formatRelationRspnDeleted()
              + "\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);
    }
  }