public ICFLibAnyObj getObjQualifier(Class qualifyingClass) {
   ICFLibAnyObj container = this;
   if (qualifyingClass != null) {
     while (container != null) {
       if (container instanceof ICFSecurityClusterObj) {
         break;
       } else if (container instanceof ICFSecurityTenantObj) {
         break;
       } else if (qualifyingClass.isInstance(container)) {
         break;
       }
       container = container.getObjScope();
     }
   } else {
     while (container != null) {
       if (container instanceof ICFSecurityClusterObj) {
         break;
       } else if (container instanceof ICFSecurityTenantObj) {
         break;
       }
       container = container.getObjScope();
     }
   }
   return (container);
 }
 public ICFLibAnyObj getNamedObject(Class qualifyingClass, String objName) {
   ICFLibAnyObj topContainer = getObjQualifier(qualifyingClass);
   if (topContainer == null) {
     return (null);
   }
   ICFLibAnyObj namedObject = topContainer.getNamedObject(objName);
   return (namedObject);
 }
 public ICFBamSchemaDefObj getSchemaDef() {
   for (ICFLibAnyObj curDef = this; curDef != null; curDef = curDef.getObjScope()) {
     if (curDef instanceof ICFBamSchemaDefObj) {
       return ((ICFBamSchemaDefObj) curDef);
     } else if (curDef instanceof ICFBamTldObj) {
       return (null);
     }
   }
   return (null);
 }
 public ICFBamTopDomainObj getCompany() {
   for (ICFLibAnyObj curDef = this; curDef != null; curDef = curDef.getObjScope()) {
     if (curDef instanceof ICFBamTopDomainObj) {
       return ((ICFBamTopDomainObj) curDef);
     } else if (curDef instanceof ICFBamTldObj) {
       return (null);
     }
   }
   return (null);
 }
 public ICFBamProjectBaseObj getProject() {
   for (ICFLibAnyObj curDef = this; curDef != null; curDef = curDef.getObjScope()) {
     if (curDef instanceof ICFBamProjectBaseObj) {
       return ((ICFBamProjectBaseObj) curDef);
     } else if (curDef instanceof ICFBamTldObj) {
       return (null);
     }
   }
   return (null);
 }
 public String getObjFullName() {
   String fullName = getObjName();
   ICFLibAnyObj container = getObjScope();
   String containerName;
   while (container != null) {
     if (container instanceof ICFSecurityClusterObj) {
       container = null;
     } else if (container instanceof ICFSecurityTenantObj) {
       container = null;
     } else {
       containerName = container.getObjName();
       fullName = containerName + "." + fullName;
       container = container.getObjScope();
     }
   }
   return (fullName);
 }
 public String getObjQualifiedName() {
   String qualName = getObjName();
   ICFLibAnyObj container = getObjScope();
   String containerName;
   while (container != null) {
     if (container instanceof ICFSecurityClusterObj) {
       container = null;
     } else if (container instanceof ICFSecurityTenantObj) {
       container = null;
     } else if (container instanceof ICFBamSchemaDefObj) {
       container = null;
     } else {
       containerName = container.getObjName();
       qualName = containerName + "." + qualName;
       container = container.getObjScope();
     }
   }
   return (qualName);
 }
 public ICFLibAnyObj getNamedObject(String objName) {
   String nextName;
   String remainingName;
   ICFLibAnyObj subObj = null;
   ICFLibAnyObj retObj;
   int nextDot = objName.indexOf('.');
   if (nextDot >= 0) {
     nextName = objName.substring(0, nextDot);
     remainingName = objName.substring(nextDot + 1);
   } else {
     nextName = objName;
     remainingName = null;
   }
   if (remainingName == null) {
     retObj = subObj;
   } else if (subObj == null) {
     retObj = null;
   } else {
     retObj = subObj.getNamedObject(remainingName);
   }
   return (retObj);
 }
  /**
   * 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);
  }