public void deleteServiceTypeByIdIdx(int ServiceTypeId) {
   CFSecurityServiceTypePKey pkey =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newPKey();
   pkey.setRequiredServiceTypeId(ServiceTypeId);
   ICFSecurityServiceTypeObj obj = readServiceType(pkey);
   if (obj != null) {
     ICFSecurityServiceTypeEditObj editObj = (ICFSecurityServiceTypeEditObj) obj.getEdit();
     boolean editStarted;
     if (editObj == null) {
       editObj = (ICFSecurityServiceTypeEditObj) 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 ICFSecurityServiceTypeObj readServiceTypeByIdIdx(int ServiceTypeId, boolean forceRead) {
   CFSecurityServiceTypePKey pkey =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newPKey();
   pkey.setRequiredServiceTypeId(ServiceTypeId);
   ICFSecurityServiceTypeObj obj = readServiceType(pkey, forceRead);
   return (obj);
 }
 public void forgetServiceTypeByIdIdx(int ServiceTypeId) {
   if (members == null) {
     return;
   }
   CFSecurityServiceTypePKey key =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newPKey();
   key.setRequiredServiceTypeId(ServiceTypeId);
   if (members.containsKey(key)) {
     ICFSecurityServiceTypeObj probed = members.get(key);
     if (probed != null) {
       probed.forget(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
      String attrServiceTypeId = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstServiceTypeRead");

      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
      CFSecurityServiceTypePKey pkey =
          ((ICFBamSchema) schemaObj.getBackingStore()).getFactoryServiceType().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("ServiceTypeId")) {
          if (attrServiceTypeId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrServiceTypeId = 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 ((attrServiceTypeId == null) || (attrServiceTypeId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "ServiceTypeId");
      }

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

      int natServiceTypeId;
      natServiceTypeId = Integer.parseInt(attrServiceTypeId);
      pkey.setRequiredServiceTypeId(natServiceTypeId);

      pkey.setRequiredServiceTypeId(natServiceTypeId);
      // Read the object and prepare the XML response
      ICFBamServiceTypeObj read =
          ((ICFBamServiceTypeObj) schemaObj.getServiceTypeTableObj().readServiceType(pkey, true));
      if (read != null) {
        String response =
            schemaFormatter.formatRspnXmlPreamble()
                + "\n"
                + "\t"
                + CFBamXMsgServiceTypeMessageFormatter.formatServiceTypeRspnSingleOpenTag()
                + CFBamXMsgServiceTypeMessageFormatter.formatServiceTypeRspnDerivedRec(
                    "\n\t\t", read.getServiceTypeBuff())
                + "\n"
                + "\t"
                + CFBamXMsgServiceTypeMessageFormatter.formatServiceTypeRspnSingleCloseTag()
                + 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);
    }
  }