public void endElement(String uri, String localName, String qName) throws SAXException {
    final String S_ProcName = "endElement";

    assert qName.equals("JavaSybaseTableImplementation");

    CFLibXmlCoreContext curContext = getParser().getCurContext();
    if (!CFBamXmlLoader.getProcessSchema(curContext)) {
      return;
    }

    CFLibXmlCoreContext parentContext = curContext.getPrevContext();
    ICFBamTableObj table;
    if (parentContext != null) {
      table = (ICFBamTableObj) parentContext.getNamedValue("Object");
    } else {
      throw CFLib.getDefaultExceptionFactory()
          .newRuntimeException(getClass(), S_ProcName, "Scope must be an existing Table element");
    }

    String text = curContext.getElementText();

    ICFBamTableEditObj editTable = (ICFBamTableEditObj) table.beginEdit();
    editTable.setOptionalJSybaseTableImplementation(text);
    editTable.update();
    editTable.endEdit();
  }
 public void setOptionalLookupRetTable(ICFBamTableObj value) {
   if (buff == null) {
     getServerListFuncBuff();
   }
   if (value != null) {
     getServerListFuncBuff().setOptionalRetTenantId(value.getRequiredTenantId());
     getServerListFuncBuff().setOptionalRetTableId(value.getRequiredId());
   } else {
     getServerListFuncBuff().setOptionalRetTenantId(null);
     getServerListFuncBuff().setOptionalRetTableId(null);
   }
   optionalLookupRetTable = value;
 }
  public void setRequiredContainerTable(ICFBamTableObj value) {
    if (buff == null) {
      getTimeColBuff();
    }
    requiredContainerTable = null;
    if (value != null) {
      getPKey().setRequiredTenantId(value.getRequiredTenantId());
      getTimeColBuff().setRequiredTenantId(value.getRequiredTenantId());
      getTimeColBuff().setRequiredTableId(value.getRequiredId());
    }
    requiredContainerTable = value;

    super.setRequiredContainerScope(value);
  }
 public ICFBamTableObj getRequiredContainerTable(boolean forceRead) {
   if (forceRead || (requiredContainerTable == null)) {
     boolean anyMissing = false;
     if (!anyMissing) {
       ICFBamTableObj obj =
           getOrigAsTimeCol()
               .getSchema()
               .getTableTableObj()
               .readTableByIdIdx(
                   getPKey().getRequiredTenantId(), getTimeColBuff().getRequiredTableId());
       requiredContainerTable = obj;
       if (obj != null) {
         getTimeColBuff().setRequiredTenantId(obj.getRequiredTenantId());
         getTimeColBuff().setRequiredTableId(obj.getRequiredId());
         requiredContainerTable = obj;
       }
     }
   }
   return (requiredContainerTable);
 }
  /**
   * The core evaluation of ColumnInOwnerRelation is also to determine if an index definition is in
   * an owner relation.
   *
   * <p>WORKING: Yes, I know. This should be a business method instead of copying the code in
   * ICFBamIndexObj and MSIsaGenBindColumnInOwnerRelation.
   *
   * @param genDef to be considered
   * @return True if the column participates in an owner relation.
   */
  public Boolean isColumnInOwnerRelation() {

    ICFLibAnyObj focusDef;
    ICFBamTableObj tableDef;
    final String S_ProcName = "isColumnInOwnerRelation() ";

    if (this instanceof ICFBamAtomObj) {
      ICFBamAtomObj atomDef = (ICFBamAtomObj) this;
      ICFLibAnyObj atomScopeDef = atomDef.getObjScope();
      tableDef = (ICFBamTableObj) atomScopeDef;
      focusDef = this;
    } else if (this instanceof ICFBamTableColObj) {
      ICFBamTableColObj tableColDef = (ICFBamTableColObj) this;
      ICFLibAnyObj tableColScopeDef = tableColDef.getObjScope();
      tableDef = (ICFBamTableObj) tableColScopeDef;
      focusDef = this;
    } else if (this instanceof ICFBamIndexColObj) {
      ICFBamIndexColObj indexColDef = (ICFBamIndexColObj) this;
      focusDef = indexColDef.getRequiredLookupColumn();
      if (focusDef instanceof ICFBamAtomObj) {
        tableDef = (ICFBamTableObj) ((ICFBamAtomObj) focusDef).getObjScope();
      } else if (focusDef instanceof ICFBamTableColObj) {
        tableDef = (ICFBamTableObj) ((ICFBamTableColObj) focusDef).getObjScope();
      } else {
        throw new RuntimeException(
            S_ProcName
                + "genContext.getGenDef().getColumnDef() for a ICFBamIndexColObj did not return a ICFBamAtomObj"
                + " nor a ICFBamTableColObj");
      }
    } else if (this instanceof ICFBamRelationColObj) {
      ICFBamRelationColObj relColDef = (ICFBamRelationColObj) this;
      ICFLibAnyObj columnDef = relColDef.getRequiredLookupFromCol();
      if (columnDef instanceof ICFBamAtomObj) {
        focusDef = columnDef;
        tableDef = (ICFBamTableObj) columnDef.getObjScope();
      } else if (columnDef instanceof ICFBamTableColObj) {
        focusDef = columnDef;
        tableDef = (ICFBamTableObj) columnDef.getObjScope();
      } else {
        throw new RuntimeException(
            S_ProcName
                + "genContext.getGenDef().getFromColumnDef() for a ICFBamIndexColObj did not return a ICFBamAtomObj"
                + " nor a ICFBamTableColObj");
      }
    } else {
      throw new RuntimeException(
          S_ProcName
              + "genContext.getGenDef() did not return a ICFBamAtomObj, ICFBamTableColObj, nor ICFBamIndexColObj instance");
    }

    List<ICFBamRelationObj> ownerRelations = tableDef.getContainerOwnerRelations();
    if ((ownerRelations == null) || ((ownerRelations != null) && (ownerRelations.size() == 0))) {
      return (false);
    }

    ListIterator<ICFBamRelationObj> ownerEnumerator = ownerRelations.listIterator();

    ICFBamRelationObj ownerRelation;
    ICFBamRelationColObj ownerRelationCol;
    Iterator<ICFBamRelationColObj> ownerRelationCols;

    while (ownerEnumerator.hasNext()) {

      ownerRelation = ownerEnumerator.next();
      ownerRelationCols = ownerRelation.getOptionalComponentsColumns().iterator();

      while (ownerRelationCols.hasNext()) {
        ownerRelationCol = ownerRelationCols.next();
        if (ownerRelationCol.getRequiredLookupFromCol() == focusDef) {
          return (true);
        }
      }
    }

    return (false);
  }