/**
   * Set the LeafNumber to query.
   *
   * @param x The LeafNumber of the OperatingsystemProfile to query.
   * @param exact to use matches or not
   * @exception DataObjectException If a database access error occurs.
   */
  public void setQueryLeafNumber(int x, boolean exact) throws DataObjectException, QueryException {
    // Remove from cacheHits any DOs that do not meet this
    // setQuery requirement.
    for (int i = 0; i < cacheHits.size() && !hitDb; i++) {
      OperatingsystemProfileDO DO = (OperatingsystemProfileDO) cacheHits.elementAt(i);
      if (null == DO) continue;
      boolean equals = true;

      // primitive types are compared using the == operator.
      equals = (DO.getLeafNumber() == x);

      if (!equals) cacheHits.removeElementAt(i--);
    }

    // Also prepare the SQL needed to query the database
    // in case there is no cache, or the query involves other tables.
    if (partialCache || hitDb)
      builder.addWhereClause("LeafNumber", x, "INTEGER", QueryBuilder.NULL_OK, exactFlag(exact));
  }