Exemplo n.º 1
0
		private AddJoinsReWriter(ISessionFactoryImplementor sessionFactory, QueryModel queryModel)
		{
			_sessionFactory = sessionFactory;
			var joiner = new Joiner(queryModel);
			_memberExpressionJoinDetector = new MemberExpressionJoinDetector(this, joiner);
			_whereJoinDetector = new WhereJoinDetector(this, joiner);
		}
		private AddJoinsReWriter(ISessionFactory sessionFactory, QueryModel queryModel)
		{
			_sessionFactory = sessionFactory;
			var joiner = new Joiner(queryModel);
			_selectJoinDetector = new SelectJoinDetector(this, joiner);
			_resultOperatorAndOrderByJoinDetector = new ResultOperatorAndOrderByJoinDetector(this, joiner);
			_whereJoinDetector = new WhereJoinDetector(this, joiner);
		}
		internal static void Find(Expression expression, NameGenerator nameGenerator, IIsEntityDecider isEntityDecider, Dictionary<string, NhJoinClause> joins, Dictionary<MemberExpression, QuerySourceReferenceExpression> expressionMap)
		{
			WhereJoinDetector f = new WhereJoinDetector(nameGenerator, isEntityDecider, joins, expressionMap);

			f.VisitExpression(expression);

			ExpressionValues values = f._values.Pop();

			foreach (var memberExpression in values.MemberExpressions)
			{
				// If outer join can never produce true, we can safely inner join.
				if (!values.GetValues(memberExpression).Contains(true))
				{
					f.MakeInnerIfJoined(memberExpression);
				}
			}
		}
Exemplo n.º 4
0
        internal static void Find(Expression expression, NameGenerator nameGenerator, IIsEntityDecider isEntityDecider, Dictionary <string, NhJoinClause> joins, Dictionary <MemberExpression, QuerySourceReferenceExpression> expressionMap)
        {
            WhereJoinDetector f = new WhereJoinDetector(nameGenerator, isEntityDecider, joins, expressionMap);

            f._memberExpressionMappings.Push(new Dictionary <string, int>());

            f.VisitExpression(expression);

            foreach (var mapping in f._memberExpressionMappings.Pop())
            {
                // If outer join can never produce true, we can safely inner join.
                if ((mapping.Value & T) == 0)
                {
                    f.MakeInnerIfJoined(mapping.Key);
                }
            }
        }
Exemplo n.º 5
0
        internal static void Find(Expression expression, NameGenerator nameGenerator, IIsEntityDecider isEntityDecider, Dictionary <string, NhJoinClause> joins, Dictionary <MemberExpression, QuerySourceReferenceExpression> expressionMap)
        {
            WhereJoinDetector f = new WhereJoinDetector(nameGenerator, isEntityDecider, joins, expressionMap);

            f.VisitExpression(expression);

            ExpressionValues values = f._values.Pop();

            foreach (var memberExpression in values.MemberExpressions)
            {
                // If outer join can never produce true, we can safely inner join.
                if (!values.GetValues(memberExpression).Contains(true))
                {
                    f.MakeInnerIfJoined(memberExpression);
                }
            }
        }
Exemplo n.º 6
0
        internal static void Find(Expression expression, NameGenerator nameGenerator, IIsEntityDecider isEntityDecider, Dictionary<string, NhJoinClause> joins, Dictionary<MemberExpression, QuerySourceReferenceExpression> expressionMap)
        {
            WhereJoinDetector f = new WhereJoinDetector(nameGenerator, isEntityDecider, joins, expressionMap);

            f._memberExpressionMappings.Push(new Dictionary<string, int>());

            f.VisitExpression(expression);

            foreach (var mapping in f._memberExpressionMappings.Pop())
            {
                // If outer join can never produce true, we can safely inner join.
                if ((mapping.Value & T) == 0)
                {
                    f.MakeInnerIfJoined(mapping.Key);
                }
            }
        }