示例#1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="QueryConverter"/> class.
		/// </summary>
		/// <param name="services">The services.</param>
		/// <param name="typeProvider">The type provider.</param>
		/// <param name="translator">The translator.</param>
		/// <param name="nodeFactory">The node factory.</param>
		internal QueryConverter(IDataServices services, TypeSystemProvider typeProvider, Translator translator, NodeFactory nodeFactory)
		{
			if(services == null)
			{
				throw Error.ArgumentNull("services");
			}
			if(nodeFactory == null)
			{
				throw Error.ArgumentNull("sql");
			}
			if(translator == null)
			{
				throw Error.ArgumentNull("translator");
			}
			if(typeProvider == null)
			{
				throw Error.ArgumentNull("typeProvider");
			}
			_services = services;
			_translator = translator;
			_nodeFactory = nodeFactory;
			_typeProvider = typeProvider;
			_parameterExpressionToSqlExpression = new Dictionary<ParameterExpression, SqlExpression>();
			_parameterExpressionToExpression = new Dictionary<ParameterExpression, Expression>();
			_parameterExpressionToSqlNode = new Dictionary<ParameterExpression, SqlNode>();
			_sqlNodeToGroupInfo = new Dictionary<SqlNode, GroupInfo>();
			_allowDeferred = true;
		}
		internal MultiSetMultiPlexer(SqlMultiplexerOptionType options, IEnumerable<SqlParameter> parentParameters, NodeFactory sqlFactory)
		{
			this.options = options;
			this.sql = sqlFactory;
			this.canJoin = true;
			this.isTopLevel = true;
			this.parentParameters = parentParameters;
		}
		internal MemberAccessBinder(SqlBinder binder, Translator translator, SqlColumnizer columnizer, NodeFactory sqlFactory, MetaModel model, DataLoadOptions shape, bool canUseOuterApply) {
			this.binder = binder;
			this.translator = translator;
			this.columnizer = columnizer;
			this.sql = sqlFactory;
			this.typeProvider = sqlFactory.TypeProvider;
			this.expander = new SqlExpander(this.sql);
			this.aggregateChecker = new SqlAggregateChecker();
			this.linkMap = new LinkOptimizationScope(null);
			this.outerAliasMap = new Dictionary<SqlAlias, SqlAlias>();
			this.model = model;
			this.shape = shape;
			this.canUseOuterApply = canUseOuterApply;
		}
示例#4
0
 internal Translator(IDataServices services, NodeFactory sqlFactory, TypeSystemProvider typeProvider) {
     this.services = services;
     this.sql = sqlFactory;
     this.typeProvider = typeProvider;
 }
示例#5
0
		internal SqlMultiplexer(SqlMultiplexerOptionType options, IEnumerable<SqlParameter> parentParameters, NodeFactory sqlFactory)
		{
			this._multiSetMultiPlexor = new MultiSetMultiPlexer(options, parentParameters, sqlFactory);
		}
		internal WhereClauseLifter(NodeFactory sql)
		{
			this.sql = sql;
			this.aggregateChecker = new SqlAggregateChecker();
			this.rowNumberChecker = new SqlRowNumberChecker();
		}
示例#7
0
		internal SqlReorderer(TypeSystemProvider typeProvider, NodeFactory sqlFactory)
		{
			this.typeProvider = typeProvider;
			this.sql = sqlFactory;
		}
示例#8
0
			internal Visitor(SqlNodeAnnotations annotations, NodeFactory sql)
			{
				this.annotations = annotations;
				this.sql = sql;
			}
		internal static SqlNode Simplify(SqlNode node, NodeFactory sql)
		{
			return new CaseSimplifier(sql).Visit(node);
		}
		internal ObjectExpressionFlattener(NodeFactory sql, SqlColumnizer columnizer)
		{
			this.sql = sql;
			this.columnizer = columnizer;
			this.isTopLevel = true;
		}
示例#11
0
		internal SqlTypeConverter(NodeFactory sql)
		{
			this.sql = sql;
		}
示例#12
0
		internal Booleanizer(NodeFactory factory)
		{
			this.sql = factory;
		}
		internal static SqlNode Convert(SqlNode node, NodeFactory sql, MetaModel model)
		{
			return new Visitor(sql, model).Visit(node);
		}
			internal Visitor(NodeFactory sql, MetaModel model)
			{
				this.sql = sql;
				this.model = model;
			}
示例#15
0
		internal CaseSimplifier(NodeFactory sql)
		{
			_sql = sql;
		}
示例#16
0
		internal TypeCorrector(NodeFactory factory)
		{
			this.sql = factory;
			this.typeProvider = factory.TypeProvider;
		}
		internal SqlMethodTransformer(NodeFactory sql)
		{
			this.sql = sql;
		}
		internal static SqlNode Reduce(SqlNode node, NodeFactory factory, SqlNodeAnnotations annotations)
		{
			Visitor r = new Visitor(factory, annotations);
			return r.Visit(node);
		}
示例#19
0
		internal SqlExpander(NodeFactory factory)
		{
			this.factory = factory;
		}
			internal Visitor(NodeFactory factory, SqlNodeAnnotations annotations)
			{
				this.factory = factory;
				this.annotations = annotations;
			}
示例#21
0
		internal static SqlNode Reduce(SqlNode node, SqlNodeAnnotations annotations, NodeFactory sql)
		{
			return new Visitor(annotations, sql).Visit(node);
		}
		internal ScalarSubQueryRewriter(NodeFactory sqlFactory)
		{
			this.sql = sqlFactory;
			this.aggregateChecker = new SqlAggregateChecker();
		}
		internal ExpressionDuplicator(NodeFactory factory)
			: base(true)
		{
			this.factory = factory;
		}
示例#24
0
		internal SqlRetyper(NodeFactory factory)
		{
			this.visitor = new TypeCorrector(factory);
		}
		internal static SqlNode Lift(SqlNode node, NodeFactory factory)
		{
			return new WhereClauseLifter(factory).Visit(node);
		}
示例#26
0
 internal SqlBinder(Translator translator, NodeFactory sqlFactory, MetaModel model, DataLoadOptions shape, SqlColumnizer columnizer, bool canUseOuterApply) {
     this.sql = sqlFactory;
     this.columnizer = columnizer;
     this.visitor = new MemberAccessBinder(this, translator, this.columnizer, this.sql, model, shape, canUseOuterApply);
 }
示例#27
0
		internal OrderByLifter(TypeSystemProvider typeProvider, NodeFactory sqlFactory)
		{
			this.orders = new List<SqlOrderExpression>();
			this.typeProvider = typeProvider;
			this.sql = sqlFactory;
		}
示例#28
0
		internal SqlFlattener(NodeFactory sql, SqlColumnizer columnizer)
		{
			this.visitor = new ObjectExpressionFlattener(sql, columnizer);
		}
		internal SqlRewriteScalarSubqueries(NodeFactory sqlFactory)
		{
			this.visitor = new ScalarSubQueryRewriter(sqlFactory);
		}
示例#30
0
 internal static SqlNode Lift(SqlNode node, NodeFactory factory)
 {
     return(new WhereClauseLifter(factory).Visit(node));
 }