public function getKeySearchRule($isUseOldValue = false, $isUseColumnName = false)
    {
        $keyFields = $this->getKeyFields();
        $retStr = "";
        foreach ($keyFields as $fieldName => $fieldObj) {
            if ($retStr != "")
                $retStr .= " AND ";
            $lhs = $isUseColumnName ? $fieldObj->column : "[$fieldName]";
            $rhs = $isUseOldValue ? $fieldObj->oldValue : $fieldObj->value;
            if ($rhs == "")
                $retStr .= "(" . $lhs . "='" . $rhs . "' or " . $lhs . " is null)";
            else
                $retStr .= $lhs . "='" . $rhs . "'";
        }
        return $retStr;
    }