internal sealed override string ConstructClassViewString(ClassViewAttribute cva, ConnectionPool pool, QueryBuilder builder, ref List<IDbDataParameter> queryParameters, ref int parCount) { string ret = "( "; foreach (SelectParameter par in _parameters) { ret += " (" + par.ConstructClassViewString(cva,pool, builder, ref queryParameters, ref parCount) + ") " + JoinString; } if (_parameters.Length > 0) return ret.Substring(0, ret.Length - JoinString.Length) + ")"; else return ""; }
internal override sealed string ConstructClassViewString(ClassViewAttribute cva, ConnectionPool pool, QueryBuilder builder, ref List<IDbDataParameter> queryParameters, ref int parCount) { string ret = FieldName+" "; if (FieldValue == null) { ret += ComparatorString + " " + builder.CreateParameterName("parameter_" + parCount.ToString()); queryParameters.Add(pool.CreateParameter(builder.CreateParameterName("parameter_" + parCount.ToString()), FieldValue)); parCount++; } else if (FieldValue.GetType().IsArray || (FieldValue is ICollection)) { if (SupportsList) { ret += " " + ComparatorString + " ( "; foreach (object obj in (IEnumerable)FieldValue) { ret += builder.CreateParameterName("parameter_" + parCount.ToString()) + ","; if (cva.Query.IsEnumField(FieldName)) queryParameters.Add(pool.CreateParameter(builder.CreateParameterName("parameter_" + parCount.ToString()), pool.GetEnumID(obj.GetType(), obj.ToString()))); else queryParameters.Add(pool.CreateParameter(builder.CreateParameterName("parameter_" + parCount.ToString()), obj)); parCount++; } ret = ret.Substring(0, ret.Length - 1); ret += " )"; } else { string tmp = ret + " " + ComparatorString+" "; ret = "("; foreach (object obj in (IEnumerable)FieldValue) { ret += tmp+builder.CreateParameterName("parameter_" + parCount.ToString()) + " OR "; if (cva.Query.IsEnumField(FieldName)) queryParameters.Add(pool.CreateParameter(builder.CreateParameterName("parameter_" + parCount.ToString()), pool.GetEnumID(obj.GetType(), obj.ToString()))); else queryParameters.Add(pool.CreateParameter(builder.CreateParameterName("parameter_" + parCount.ToString()), obj)); parCount++; } ret = ret.Substring(0, ret.Length - 3); ret += ")"; } } else { ret += ComparatorString + " "; ret += builder.CreateParameterName("parameter_" + parCount.ToString()); if (cva.Query.IsEnumField(FieldName)) queryParameters.Add(pool.CreateParameter(builder.CreateParameterName("parameter_" + parCount.ToString()), pool.GetEnumID(FieldValue.GetType(), FieldValue.ToString()))); else queryParameters.Add(pool.CreateParameter(builder.CreateParameterName("parameter_" + parCount.ToString()), FieldValue)); parCount++; } return ret; }
internal override string ConstructClassViewString(ClassViewAttribute cva, ConnectionPool pool, QueryBuilder builder, ref List<System.Data.IDbDataParameter> queryParameters, ref int parCount) { return "NOT ( " + _negatedParameter.ConstructClassViewString(cva, pool, builder, ref queryParameters, ref parCount) + " ) "; }
internal abstract string ConstructClassViewString(ClassViewAttribute cva,ConnectionPool pool,QueryBuilder builder, ref List<IDbDataParameter> queryParameters, ref int parCount);