public Expression AddJoin(Expression expression, string key) { NhJoinClause join; if (!_joins.TryGetValue(key, out join)) { join = new NhJoinClause(_nameGenerator.GetNewName(), expression.Type, expression); _queryModel.BodyClauses.Add(join); _joins.Add(key, join); } return new QuerySourceReferenceExpression(@join); }
protected internal Expression AddJoin(MemberExpression expression) { string key = ExpressionKeyVisitor.Visit(expression, null); NhJoinClause join; if (!_joins.TryGetValue(key, out join)) { join = new NhJoinClause(_nameGenerator.GetNewName(), expression.Type, expression); _joins.Add(key, join); } QuerySourceReferenceExpression newExpr = new QuerySourceReferenceExpression(join); if (!_expressionMap.ContainsKey(expression)) _expressionMap.Add(expression, newExpr); return newExpr; }
private void VisitNhJoinClause(string querySourceName, NhJoinClause joinClause) { var expression = HqlGeneratorExpressionTreeVisitor.Visit(joinClause.FromExpression, VisitorParameters).AsExpression(); var alias = _hqlTree.TreeBuilder.Alias(querySourceName); HqlTreeNode hqlJoin; if (joinClause.IsInner) { hqlJoin = _hqlTree.TreeBuilder.Join(expression, @alias); } else { hqlJoin = _hqlTree.TreeBuilder.LeftJoin(expression, @alias); } foreach (var withClause in joinClause.Restrictions) { var booleanExpression = HqlGeneratorExpressionTreeVisitor.Visit(withClause.Predicate, VisitorParameters).AsBooleanExpression(); hqlJoin.AddChild(_hqlTree.TreeBuilder.With(booleanExpression)); } _hqlTree.AddFromClause(hqlJoin); }
private void AddJoin(QueryModel queryModel, NhJoinClause joinClause) { queryModel.BodyClauses.Add(joinClause); }
public virtual void VisitNhJoinClause(NhJoinClause joinClause, QueryModel queryModel, int index) { }
public override void VisitNhJoinClause(NhJoinClause joinClause, QueryModel queryModel, int index) { _namer.Add(joinClause); }