public void batchRelate(
      ModelRoot modelRoot, boolean relateProxies, boolean notifyChanges, boolean searchAllRoots) {
    InstanceList instances = null;
    ModelRoot baseRoot = modelRoot;

    // R9600
    Query_c relInst39590 =
        (Query_c) baseRoot.getInstanceList(Query_c.class).get(new Object[] {m_id});
    // if there was no local element, check for any global elements
    // failing that proceed to check other model roots
    if (relInst39590 == null) {
      relInst39590 =
          (Query_c)
              Ooaofooa.getDefaultInstance().getInstanceList(Query_c.class).get(new Object[] {m_id});
    }
    if (relInst39590 == null && searchAllRoots && !baseRoot.isCompareRoot()) {
      Ooaofooa[] roots = Ooaofooa.getInstances();
      for (int i = 0; i < roots.length; i++) {
        if (roots[i].isCompareRoot()) {
          // never use elements from any compare root
          continue;
        }
        relInst39590 = (Query_c) roots[i].getInstanceList(Query_c.class).get(new Object[] {m_id});
        if (relInst39590 != null) break;
      }
    }
    // synchronized
    if (relInst39590 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst39590) && !isProxy())) {
        relInst39590.relateAcrossR9600To(this, notifyChanges);
      }
    }
  }
  public void unrelateAcrossR9600From(Query_c target, boolean notifyChanges) {
    if (target == null) return;

    if (IsSupertypeQuery == null) return; // already unrelated

    if (target != IsSupertypeQuery) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CorePlugin.logError("Tried to unrelate from non-related instance across R9600", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR9600To(this);
    }

    if (IsSupertypeQuery != null) {

      m_id = IsSupertypeQuery.getId();
      IsSupertypeQuery = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "9600", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  public void relateAcrossR9600To(Query_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == IsSupertypeQuery) return; // already related

    if (IsSupertypeQuery != target) {

      Object oldKey = getInstanceKey();

      if (IsSupertypeQuery != null) {

        IsSupertypeQuery.clearBackPointerR9600To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "DescriptionQuery_c.relateAcrossR9600To(Query_c target)",
              "Relate performed across R9600 from Description Query to Query without unrelate of prior instance.");
        }
      }

      IsSupertypeQuery = target;
      m_id = target.getId();
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR9600To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "9600", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  // declare transform functions
  public void Configureparticipants(final Object p_Monitor) {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Description Query",
        " Operation entered: DescriptionQuery::Configureparticipants");
    final ModelRoot modelRoot = getModelRoot();
    Query_c v_query = Query_c.getOneSQU_QOnR9600(this);

    Search_c.Gatherparticipants(p_Monitor, v_query.getId());
  } // End configureParticipants
  public boolean delete() {
    boolean result = super.delete();
    boolean delete_error = false;
    String errorMsg =
        "The following relationships were not torn down by the Description Query.dispose call: ";
    Query_c testR9600Inst3 = Query_c.getOneSQU_QOnR9600(this, false);

    if (testR9600Inst3 != null) {
      delete_error = true;
      errorMsg = errorMsg + "9600 ";
    }
    if (delete_error == true) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(ILogger.DELETE, "Description Query", errorMsg);
      } else {
        Exception e = new Exception();
        e.fillInStackTrace();
        CorePlugin.logError(errorMsg, e);
      }
    }
    return result;
  }
  public void Createparticipant(
      final String p_Classname,
      final Object p_Elementid,
      final String p_Modelrootid,
      final String p_Searchablevalue) {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Description Query",
        " Operation entered: DescriptionQuery::Createparticipant");
    final ModelRoot modelRoot = getModelRoot();
    SearchParticipant_c v_participant = new SearchParticipant_c(modelRoot);
    Ooaofooa.getDefaultInstance()
        .fireModelElementCreated(
            new BaseModelDelta(Modeleventnotification_c.DELTA_NEW, v_participant));

    SearchableElement_c v_searchable = new SearchableElement_c(modelRoot);
    Ooaofooa.getDefaultInstance()
        .fireModelElementCreated(
            new BaseModelDelta(Modeleventnotification_c.DELTA_NEW, v_searchable));

    DescriptionSearchable_c v_descriptionParticipant = new DescriptionSearchable_c(modelRoot);
    Ooaofooa.getDefaultInstance()
        .fireModelElementCreated(
            new BaseModelDelta(Modeleventnotification_c.DELTA_NEW, v_descriptionParticipant));

    if (v_searchable != null) {
      v_searchable.relateAcrossR9700To(v_participant);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Relate attempted on null left hand instance.", t);
    }

    if (v_searchable != null) {
      v_searchable.setModelrootid(p_Modelrootid);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Attribute write attempted on null instance.", t);
    }

    if (v_searchable != null) {
      v_searchable.setElementid(p_Elementid);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Attribute write attempted on null instance.", t);
    }

    if (v_searchable != null) {
      v_searchable.setClassname(p_Classname);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Attribute write attempted on null instance.", t);
    }

    if (v_descriptionParticipant != null) {
      v_descriptionParticipant.setSearchablevalue(p_Searchablevalue);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Attribute write attempted on null instance.", t);
    }

    if (v_descriptionParticipant != null) {
      v_descriptionParticipant.relateAcrossR9702To(v_searchable);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Relate attempted on null left hand instance.", t);
    }

    SearchEngine_c v_engine = SearchEngine_c.getOneSEN_EOnR9500(Query_c.getOneSQU_QOnR9600(this));

    if (v_engine != null) {
      v_engine.relateAcrossR9502To(v_participant);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Relate attempted on null left hand instance.", t);
    }
  } // End createParticipant
 public boolean evaluate(Object candidate) {
   Query_c selected = (Query_c) candidate;
   boolean retval = false;
   retval = (selected.getId().equals(m_p39598));
   return retval;
 }
  public boolean checkConsistency() {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Description Query", //$NON-NLS-1$
        " Operation entered: Description Query::checkConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return true;
    }
    ModelRoot modelRoot = getModelRoot();
    boolean retval = true;
    class DescriptionQuery_c_test39592_c implements ClassQueryInterface_c {
      DescriptionQuery_c_test39592_c(java.util.UUID p39593) {
        m_p39593 = p39593;
      }

      private java.util.UUID m_p39593;

      public boolean evaluate(Object candidate) {
        DescriptionQuery_c selected = (DescriptionQuery_c) candidate;
        boolean retval = false;
        retval = (selected.getId().equals(m_p39593));
        return retval;
      }
    }

    DescriptionQuery_c[] objs39591 =
        DescriptionQuery_c.DescriptionQueryInstances(
            modelRoot, new DescriptionQuery_c_test39592_c(getId()));

    if (((objs39591.length) == 0)) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Description Query", //$NON-NLS-1$
            "Consistency: Object: Description Query: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs39591.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Description Query: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39591.length),
            e);
      }
      retval = false;
    }

    if (((objs39591.length) > 1)) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Description Query", //$NON-NLS-1$
            "Consistency: Object: Description Query: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39591.length)
                + " Id: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Description Query: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39591.length)
                + " Id: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    // Description Query is a subtype in association: rel.Numb = 9600
    // The supertype class is: Query
    class Query_c_test39597_c implements ClassQueryInterface_c {
      Query_c_test39597_c(java.util.UUID p39598) {
        m_p39598 = p39598;
      }

      private java.util.UUID m_p39598;

      public boolean evaluate(Object candidate) {
        Query_c selected = (Query_c) candidate;
        boolean retval = false;
        retval = (selected.getId().equals(m_p39598));
        return retval;
      }
    }

    Query_c[] objs39596 = Query_c.QueryInstances(modelRoot, new Query_c_test39597_c(getId()));

    if (((objs39596.length) != 1)) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Description Query", //$NON-NLS-1$
            "Consistency: Object: Description Query: Association: 9600: Cardinality of a supertype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs39596.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Description Query: Association: 9600: Cardinality of a supertype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39596.length),
            e);
      }
      retval = false;
    }

    return retval;
  }
 public java.util.UUID getId() {
   if (IsSupertypeQuery != null) {
     return IsSupertypeQuery.getId();
   }
   return IdAssigner.NULL_UUID;
 }
 // declare attribute accessors
 public long getIdLongBased() {
   if (IsSupertypeQuery != null) {
     return IsSupertypeQuery.getIdLongBased();
   }
   return 0;
 }
 public static DescriptionQuery_c getOneSQU_DEOnR9600(Query_c target, ClassQueryInterface_c test) {
   if (target != null) {
     return getOneSQU_DEOnR9600(target.getModelRoot(), target, test);
   }
   return null;
 }
 public static DescriptionQuery_c getOneSQU_DEOnR9600(Query_c target, boolean loadComponent) {
   return getOneSQU_DEOnR9600(target.getModelRoot(), target, null, loadComponent);
 }