Skip to content

Commit d6e054f

Browse files
bahusoidfredericDelaporte
authored andcommitted
Remove no longer used code in QueryModelVisitor
1 parent 9255435 commit d6e054f

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

src/NHibernate/Linq/Clauses/NhJoinClause.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public NhJoinClause(string itemName, System.Type itemType, Expression fromExpres
5454

5555
public bool IsInner { get; private set; }
5656

57-
internal JoinClause ParentJoinClause { get; set; }
58-
5957
public void TransformExpressions(Func<Expression, Expression> transformation)
6058
{
6159
if (transformation == null) throw new ArgumentNullException(nameof(transformation));

src/NHibernate/Linq/Visitors/QueryModelVisitor.cs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -576,27 +576,10 @@ private void AddJoin(JoinClause joinClause, QueryModel queryModel, bool innerJoi
576576
var withClause = equalityVisitor.Visit(joinClause.InnerKeySelector, joinClause.OuterKeySelector);
577577
var alias = _hqlTree.TreeBuilder.Alias(VisitorParameters.QuerySourceNamer.GetName(joinClause));
578578
var joinExpression = HqlGeneratorExpressionVisitor.Visit(joinClause.InnerSequence, VisitorParameters);
579-
HqlTreeNode join;
580-
// When associations are located inside the inner key selector we have to use a cross join instead of an inner
581-
// join and add the condition in the where statement.
582-
if (queryModel.BodyClauses.OfType<NhJoinClause>().Any(o => o.ParentJoinClause == joinClause))
583-
{
584-
if (!innerJoin)
585-
{
586-
throw new NotSupportedException("Left joins that have association properties in the inner key selector are not supported.");
587-
}
588-
589-
_hqlTree.AddWhereClause(withClause);
590-
join = CreateCrossJoin(joinExpression, alias);
591-
}
592-
else
593-
{
594-
join = innerJoin
595-
? _hqlTree.TreeBuilder.InnerJoin(joinExpression.AsExpression(), alias)
596-
: (HqlTreeNode) _hqlTree.TreeBuilder.LeftJoin(joinExpression.AsExpression(), alias);
597-
join.AddChild(_hqlTree.TreeBuilder.With(withClause));
598-
}
599-
579+
var join = innerJoin
580+
? _hqlTree.TreeBuilder.InnerJoin(joinExpression.AsExpression(), alias)
581+
: (HqlTreeNode) _hqlTree.TreeBuilder.LeftJoin(joinExpression.AsExpression(), alias);
582+
join.AddChild(_hqlTree.TreeBuilder.With(withClause));
600583
_hqlTree.AddFromClause(join);
601584
}
602585

0 commit comments

Comments
 (0)