/**
   * Set the OID to query. WARNING! This method assumes that table <CODE>OperatingsystemProfile
   * </CODE> has a column named <CODE>"oid"</CODE>. This method is called from the DO classes to
   * retrieve an object by id.
   *
   * @param oid The object id to query.
   */
  public void setQueryOId(ObjectId oid) {
    // Remove from cacheHits any DOs that do not meet this
    // setQuery requirement.
    if (null == oid) return;
    requireUniqueInstance();
    for (int i = 0; i < cacheHits.size(); i++) {
      OperatingsystemProfileDO DO = (OperatingsystemProfileDO) cacheHits.elementAt(i);
      if (null == DO) continue;
      boolean equals = true;
      ObjectId id = DO.getOId();
      if (null == id || !id.equals(oid)) cacheHits.removeElementAt(i--);
    }

    // Also prepare the SQL needed to query the database
    // in case there is no cache, or the query involves other tables.
    builder.addWhereClause("oid", oid.toBigDecimal(), QueryBuilder.NOT_NULL);
  }