Skip to content

Commit 5d9f693

Browse files
committed
HHH-14351 Fix order by type discriminator rendering issue
1 parent d2036cb commit 5d9f693

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hibernate-core/src/main/antlr/sql-gen.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ orderExprs { String ordExp = null; String ordDir = null; String ordNul = null; }
199199
(dir:orderDirection { ordDir = #dir.getText(); })? (ordNul=nullOrdering)?
200200
// SQL Tokens can be passed through as-is.
201201
// These tokens could be mapping defined order by fragments which are already rendered via the dialect hook
202-
{ out( #e.getType() == SQL_TOKEN ? ordExp : renderOrderByElement( ordExp, ordDir, ordNul ) ); }
202+
{ out( #e.getType() == SQL_TOKEN && ordDir == null && ordNul == null ? ordExp : renderOrderByElement( ordExp, ordDir, ordNul ) ); }
203203
( {out(", "); } orderExprs )?
204204
;
205205

0 commit comments

Comments
 (0)