Skip to content

Commit 8e27ffd

Browse files
authored
Simplify SqlGenerator.FromFragmentSeparator (#3116)
1 parent 5ae988f commit 8e27ffd

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs

+4-25
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ protected virtual void FromFragmentSeparator(IASTNode a)
183183
return;
184184
}
185185

186-
var left = (FromElement)a;
187-
var right = (FromElement)next;
186+
var right = (FromElement) next;
188187

189188
///////////////////////////////////////////////////////////////////////
190189
// HACK ALERT !!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -210,34 +209,14 @@ protected virtual void FromFragmentSeparator(IASTNode a)
210209
{
211210
return;
212211
}
213-
if (right.Type == ENTITY_JOIN)
212+
213+
if (right.JoinSequence?.IsThetaStyle == false && right.JoinSequence.JoinCount != 0)
214214
{
215215
Out(" ");
216216
}
217-
else if (right.RealOrigin == left || (right.RealOrigin != null && right.RealOrigin == left.RealOrigin))
218-
{
219-
// right represents a joins originating from left; or
220-
// both right and left reprersent joins originating from the same FromElement
221-
if (right.JoinSequence != null && right.JoinSequence.IsThetaStyle)
222-
{
223-
Out(", ");
224-
}
225-
else
226-
{
227-
Out(" ");
228-
}
229-
}
230217
else
231218
{
232-
if (right.JoinSequence?.IsThetaStyle == false && right.JoinSequence.JoinCount != 0)
233-
{
234-
Out(" ");
235-
}
236-
else
237-
{
238-
// these are just two unrelated table references
239-
Out(", ");
240-
}
219+
Out(", ");
241220
}
242221
}
243222

0 commit comments

Comments
 (0)