コード例 #1
0
        internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters)
        {
            List <DataParameter> list = new List <DataParameter> ();
            Type   objType            = _value.GetType();
            object obj = null;

            if (objType == typeof(byte[]))
            {
                obj = Encoding.UTF8.GetString((byte[])_value);
            }
            else if (objType == typeof(char[]))
            {
                obj = new string ((char[])_value);
            }
            else
            {
                obj = _value;
            }
            if (_value is System.Collections.IEnumerable && obj.GetType() != typeof(string))
            {
                System.Collections.IEnumerable values = (System.Collections.IEnumerable)obj;
                foreach (object value in values)
                {
                    string pn = factory.CreateTempParamName();
                    list.Add(new DataParameter(pn, _fieldInfo.DataField.ToColumn(value), _fieldInfo.DBType));
                }
            }
            else
            {
                string pn = factory.CreateTempParamName();
                list.Add(new DataParameter(pn, _fieldInfo.DataField.ToColumn(obj), _fieldInfo.DBType));
            }
            dataParameters = list.ToArray();
            return(factory.CreateCollectionMatchQuerySql(_fieldInfo.CreateDataFieldSql(factory), _isReverse, _isMatch, _isNot, list));
        }
コード例 #2
0
        internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters)
        {
            string        pn            = factory.CreateTempParamName();
            DataParameter dataParameter = new DataParameter(pn, _fieldInfo.DataField.ToColumn(_value), _fieldInfo.DBType);

            dataParameters = new DataParameter[] { dataParameter };
            return(factory.CreateSingleParamSql(_fieldInfo.CreateDataFieldSql(factory), _predicate, _isReverse, dataParameter));
        }
コード例 #3
0
        internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters)
        {
            string pn  = factory.CreateTempParamName();
            string pn1 = factory.CreateTempParamName();

            DataParameter fromParam = new DataParameter(pn, _fieldInfo.DataField.ToColumn(_fromValue), _fieldInfo.DBType);
            DataParameter toParam   = new DataParameter(pn1, _fieldInfo.DataField.ToColumn(_toValue), _fieldInfo.DBType);

            dataParameters = new DataParameter[] { fromParam, toParam };
            return(factory.CreateBetweenParamsQuerySql(_fieldInfo.CreateDataFieldSql(factory), _isNot, fromParam, toParam));
        }
コード例 #4
0
        internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters)
        {
            List <DataParameter> list = new List <DataParameter> ();

            foreach (object value in _values)
            {
                string pn = factory.CreateTempParamName();
                list.Add(new DataParameter(pn, _fieldInfo.DataField.ToColumn(value), _fieldInfo.DBType));
            }
            dataParameters = list.ToArray();
            return(factory.CreateCollectionParamsQuerySql(_fieldInfo.CreateDataFieldSql(factory), _predicate, list));
        }
コード例 #5
0
        internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters, GetAliasHandler handler)
        {
            string alise = handler(_function);

            if (string.IsNullOrEmpty(alise))
            {
                return(CreateSqlString(factory, out dataParameters));
            }
            string name        = factory.CreateDataFieldSql(alise);
            string queryString = null;

            queryString = _queryExpression.CreateSqlString(factory, out dataParameters);
            return(factory.CreateSubQuerySql(name, _predicate, _queryFieldInfo.CreateDataFieldSql(factory), factory.CreateDataTableSql(_queryFieldInfo.TableMapping), queryString));
        }
コード例 #6
0
        internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters)
        {
            string queryString = null;

            if (_queryExpression == null)
            {
                dataParameters = new DataParameter[0];
            }
            else
            {
                queryString = _queryExpression.CreateSqlString(factory, out dataParameters);
            }
            return(factory.CreateSubQuerySql(_fieldInfo.CreateDataFieldSql(factory), _predicate, _queryFieldInfo.CreateDataFieldSql(factory), factory.CreateDataTableSql(_queryFieldInfo.TableMapping), queryString));
        }
コード例 #7
0
 internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters)
 {
     dataParameters = new DataParameter[0];
     return(factory.CreateBooleanQuerySql(_fieldInfo.CreateDataFieldSql(factory), _isTrue));
 }
コード例 #8
0
 internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters)
 {
     dataParameters = new DataParameter[0];
     return(factory.CreateOrderBySql(_fieldInfo.CreateDataFieldSql(factory), _orderType));
 }
コード例 #9
0
 internal override string CreateSqlString(CommandFactory factory, out DataParameter[] dataParameters)
 {
     dataParameters = new DataParameter[0];
     return(factory.CreateRelationTableSql(_fieldInfo.CreateDataFieldSql(factory), _predicate, _isReverse, _relateFieldInfo.CreateDataFieldSql(factory, !_isSameTable)));
 }