Add the criteria to the SQL string.
771142
public boolean doRemoteCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
    {
        BaseField fldTarget = null;
        if (typeFieldName != null)
            fldTarget = this.getOwner().getField(typeFieldName);
        else
            fldTarget = this.getOwner().getField(m_iTypeField);
        String strToCompare = Integer.toString(m_iTargetValue);
        boolean bDontSkip = this.fieldCompare(fldTarget, strToCompare, DBConstants.EQUALS, strbFilter, bIncludeFileName, vParamList);
        if (strbFilter != null)
            bDontSkip = true; // Don't need to compare, if I'm creating a filter to pass to SQL 
        if (bDontSkip)
            return super.doRemoteCriteria(strbFilter, bIncludeFileName, vParamList);    // Dont skip this record
        else
            return false;   // Skip this one
    }
411423
private void appendLikeCriteria(TableAlias alias, PathInfo pathInfo, LikeCriteria c, StringBuffer buf)
    {
        appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
        buf.append(c.getClause());
        appendParameter(c.getValue(), buf);

        buf.append(m_platform.getEscapeClause(c));
    }
1147709
def _addDBParam(self, name, value):
		""""""

		if name[-4:] == '__OP':
			return self._setComparasionOperator(name[:-4], value)
		if name[-3:] == '.op':
			return self._setComparasionOperator(name[:-3], value)
		if name.find('__') != -1:
			import re
			name = name.replace('__','::')
		elif name.find('.') != -1:
			name = name.replace('.','::')

		self._dbParams.append(
			[name, value]
		)
1252963
public function buildCriteria()
    {
        $criteria = new Criteria(DealerVersionTableMap::DATABASE_NAME);

        if ($this->isColumnModified(DealerVersionTableMap::ID)) $criteria->add(DealerVersionTableMap::ID, $this->id);
        if ($this->isColumnModified(DealerVersionTableMap::VISIBLE)) $criteria->add(DealerVersionTableMap::VISIBLE, $this->visible);
        if ($this->isColumnModified(DealerVersionTableMap::ADDRESS1)) $criteria->add(DealerVersionTableMap::ADDRESS1, $this->address1);
        if ($this->isColumnModified(DealerVersionTableMap::ADDRESS2)) $criteria->add(DealerVersionTableMap::ADDRESS2, $this->address2);
        if ($this->isColumnModified(DealerVersionTableMap::ADDRESS3)) $criteria->add(DealerVersionTableMap::ADDRESS3, $this->address3);
        if ($this->isColumnModified(DealerVersionTableMap::ZIPCODE)) $criteria->add(DealerVersionTableMap::ZIPCODE, $this->zipcode);
        if ($this->isColumnModified(DealerVersionTableMap::CITY)) $criteria->add(DealerVersionTableMap::CITY, $this->city);
        if ($this->isColumnModified(DealerVersionTableMap::COUNTRY_ID)) $criteria->add(DealerVersionTableMap::COUNTRY_ID, $this->country_id);
        if ($this->isColumnModified(DealerVersionTableMap::LATITUDE)) $criteria->add(DealerVersionTableMap::LATITUDE, $this->latitude);
        if ($this->isColumnModified(DealerVersionTableMap::LONGITUDE)) $criteria->add(DealerVersionTableMap::LONGITUDE, $this->longitude);
        if ($this->isColumnModified(DealerVersionTableMap::CREATED_AT)) $criteria->add(DealerVersionTableMap::CREATED_AT, $this->created_at);
        if ($this->isColumnModified(DealerVersionTableMap::UPDATED_AT)) $criteria->add(DealerVersionTableMap::UPDATED_AT, $this->updated_at);
        if ($this->isColumnModified(DealerVersionTableMap::VERSION)) $criteria->add(DealerVersionTableMap::VERSION, $this->version);
        if ($this->isColumnModified(DealerVersionTableMap::VERSION_CREATED_AT)) $criteria->add(DealerVersionTableMap::VERSION_CREATED_AT, $this->version_created_at);
        if ($this->isColumnModified(DealerVersionTableMap::VERSION_CREATED_BY)) $criteria->add(DealerVersionTableMap::VERSION_CREATED_BY, $this->version_created_by);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_SHEDULES_IDS)) $criteria->add(DealerVersionTableMap::DEALER_SHEDULES_IDS, $this->dealer_shedules_ids);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_SHEDULES_VERSIONS)) $criteria->add(DealerVersionTableMap::DEALER_SHEDULES_VERSIONS, $this->dealer_shedules_versions);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_CONTACT_IDS)) $criteria->add(DealerVersionTableMap::DEALER_CONTACT_IDS, $this->dealer_contact_ids);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_CONTACT_VERSIONS)) $criteria->add(DealerVersionTableMap::DEALER_CONTACT_VERSIONS, $this->dealer_contact_versions);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_CONTENT_IDS)) $criteria->add(DealerVersionTableMap::DEALER_CONTENT_IDS, $this->dealer_content_ids);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_CONTENT_VERSIONS)) $criteria->add(DealerVersionTableMap::DEALER_CONTENT_VERSIONS, $this->dealer_content_versions);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_FOLDER_IDS)) $criteria->add(DealerVersionTableMap::DEALER_FOLDER_IDS, $this->dealer_folder_ids);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_FOLDER_VERSIONS)) $criteria->add(DealerVersionTableMap::DEALER_FOLDER_VERSIONS, $this->dealer_folder_versions);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_BRAND_IDS)) $criteria->add(DealerVersionTableMap::DEALER_BRAND_IDS, $this->dealer_brand_ids);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_BRAND_VERSIONS)) $criteria->add(DealerVersionTableMap::DEALER_BRAND_VERSIONS, $this->dealer_brand_versions);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_PRODUCT_IDS)) $criteria->add(DealerVersionTableMap::DEALER_PRODUCT_IDS, $this->dealer_product_ids);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_PRODUCT_VERSIONS)) $criteria->add(DealerVersionTableMap::DEALER_PRODUCT_VERSIONS, $this->dealer_product_versions);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_ADMIN_IDS)) $criteria->add(DealerVersionTableMap::DEALER_ADMIN_IDS, $this->dealer_admin_ids);
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_ADMIN_VERSIONS)) $criteria->add(DealerVersionTableMap::DEALER_ADMIN_VERSIONS, $this->dealer_admin_versions);

        return $criteria;
    }
476989
public function orWhere($sql=null, $params=array())
    {
        if(!isset($this->_where))
            $this->_where = new Criteria();

        $this->_where->or(new Criteria($sql, $params));

        return $this;
    }
761673
public static final void appendValueToSql(StringBuilder sql, Object value) {
        if (value == null) {
            sql.append("NULL");
        } else if (value instanceof Boolean) {
            Boolean bool = (Boolean)value;
            if (bool) {
                sql.append('1');
            } else {
                sql.append('0');
            }
        } else {
            appendEscapedSQLString(sql, value.toString());
        }
    }
924201
public function buildCriteria()
    {
        $criteria = new Criteria(DealerFolderVersionTableMap::DATABASE_NAME);

        if ($this->isColumnModified(DealerFolderVersionTableMap::ID)) $criteria->add(DealerFolderVersionTableMap::ID, $this->id);
        if ($this->isColumnModified(DealerFolderVersionTableMap::DEALER_ID)) $criteria->add(DealerFolderVersionTableMap::DEALER_ID, $this->dealer_id);
        if ($this->isColumnModified(DealerFolderVersionTableMap::FOLDER_ID)) $criteria->add(DealerFolderVersionTableMap::FOLDER_ID, $this->folder_id);
        if ($this->isColumnModified(DealerFolderVersionTableMap::CREATED_AT)) $criteria->add(DealerFolderVersionTableMap::CREATED_AT, $this->created_at);
        if ($this->isColumnModified(DealerFolderVersionTableMap::UPDATED_AT)) $criteria->add(DealerFolderVersionTableMap::UPDATED_AT, $this->updated_at);
        if ($this->isColumnModified(DealerFolderVersionTableMap::VERSION)) $criteria->add(DealerFolderVersionTableMap::VERSION, $this->version);
        if ($this->isColumnModified(DealerFolderVersionTableMap::VERSION_CREATED_AT)) $criteria->add(DealerFolderVersionTableMap::VERSION_CREATED_AT, $this->version_created_at);
        if ($this->isColumnModified(DealerFolderVersionTableMap::VERSION_CREATED_BY)) $criteria->add(DealerFolderVersionTableMap::VERSION_CREATED_BY, $this->version_created_by);
        if ($this->isColumnModified(DealerFolderVersionTableMap::DEALER_ID_VERSION)) $criteria->add(DealerFolderVersionTableMap::DEALER_ID_VERSION, $this->dealer_id_version);
        if ($this->isColumnModified(DealerFolderVersionTableMap::FOLDER_ID_VERSION)) $criteria->add(DealerFolderVersionTableMap::FOLDER_ID_VERSION, $this->folder_id_version);

        return $criteria;
    }
381728
public function sqlFilters()
    {
        if (!$this->hasFilters()) {
            return '';
        }

        $criteria = $this->createFilter([
            'filters' => $this->filters()
        ]);

        $sql = $criteria->sql();
        if (strlen($sql) > 0) {
            $sql = ' WHERE '.$sql;
        }

        return $sql;
    }
552363
def create_criteria(entry, id)
      @entry = entry

      type = attr_val('@datatype')
      name = attr_val('@name')
      instance = attr_val('@instance')

      @description = "#{type}: #{name}"
      @title = name
      @code_list_id = attr_val('@oid')

      @hqmf_id = attr_val('@uuid')

      parts = type.split(',')
      def_and_status = parse_definition_and_status(type)
      @definition = def_and_status[:definition]
      @status = def_and_status[:status]

      specifics_counter = nil
      if instance
        fix_description_for_hqmf_match()
        specifics_counter = HQMF::Counter.instance.next
        @specific_occurrence = instance.split[1]
        @specific_occurrence_const = DataCriteria.format_so_const(@description)
        @id = id || format_id("#{instance} #{@title}#{specifics_counter}")
      else
        @id = id || format_id("#{@description}")
      end

      handle_transfer() if (['transfer_from', 'transfer_to'].include? definition)


    end
870641
def _make_sql_params(self,kw):
        """"""
        return ['%s=?' %k for k in kw.keys() ]
        for k,v in kw.iteritems():
            vals.append('%s=?' %k)
        return vals
1122293
def add_constraints(self):
        
        if self._constraints:
            self._query.where(self._foreign_key, "=", self.get_parent_key())
285236
private void addQueryParametersFromManager(IFilterCriteriaManager manager) {
        Map<FilterCriteriaType, IFilterCriteria> criterias = manager.getFilterCriterias();
        for (FilterCriteriaType type : criterias.keySet()) {
            IFilterCriteria criteria = criterias.get(type);
            if (criteria == null) continue;
            if (criteria.getModel().getObject() != null) {
                if (type.equals(FilterCriteriaType.RANGE)) {
                    List<?> list = (List<?>) criteria.getModel().getObject();
                    Object first = list.get(0);
                    Object second = list.get(1);
                    if (first != null && second != null) {
                        setParameter(criteria.getName() + 0, Model.of((Serializable) first));
                        setParameter(criteria.getName() + 1, Model.of((Serializable) second));
                    } else setParameter(criteria.getName(), Model.of(first != null ? (Serializable) first : (Serializable) second));
                } else setParameter(criteria.getName(), criteria.getModel());
            }
        }
    }
1011295
public function buildCriteria()
    {
        $criteria = new Criteria(CountryPeer::DATABASE_NAME);

        if ($this->isColumnModified(CountryPeer::ID)) $criteria->add(CountryPeer::ID, $this->id);
        if ($this->isColumnModified(CountryPeer::CODE)) $criteria->add(CountryPeer::CODE, $this->code);
        if ($this->isColumnModified(CountryPeer::EN)) $criteria->add(CountryPeer::EN, $this->en);
        if ($this->isColumnModified(CountryPeer::DE)) $criteria->add(CountryPeer::DE, $this->de);

        return $criteria;
    }
81188
private void appendFieldCriteria(TableAlias alias, PathInfo pathInfo, FieldCriteria c, StringBuffer buf)
    {
        appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
        buf.append(c.getClause());

        if (c.isTranslateField())
        {
			appendColName((String) c.getValue(), false, c.getUserAlias(), buf);
        }
        else
        {
            buf.append(c.getValue());
        }
    }
1326171
private static DBObject addFieldExistsCriterion(DBObject query, String field) {
        return new BasicDBObject(query.toMap()).append(field, new BasicDBObject("$exists", true));
    }
892351
public @NotNull QueryBuilder append(@NotNull String sql, @NotNull Collection<?> args) {
        query.append(requireNonNull(sql));
        addArguments(args);
        return this;
    }
1309086
private int bindStatement(PreparedStatement stmt, int index, ExistsCriteria crit, ClassDescriptor cld) throws SQLException
    {
        Query subQuery = (Query) crit.getValue();

        // if query has criteria, bind them
        if (subQuery.getCriteria() != null && !subQuery.getCriteria().isEmpty())
        {
            return bindStatement(stmt, subQuery.getCriteria(), cld.getRepository().getDescriptorFor(subQuery.getSearchClass()), index);

            // otherwise, just ignore it
        }
        else
        {
            return index;
        }
    }