@@ -336,8 +336,8 @@ public QueryTokenStream visitEntityWithJoins(HqlParser.EntityWithJoinsContext ct
336336
337337 QueryRendererBuilder builder = QueryRenderer .builder ();
338338
339- builder .appendExpression (visit (ctx .fromRoot ()));
340- builder .appendInline (QueryTokenStream .concat (ctx .joinSpecifier (), this ::visit , TOKEN_SPACE ));
339+ builder .appendInline (visit (ctx .fromRoot ()));
340+ builder .appendInline (QueryTokenStream .concat (ctx .joinSpecifier (), this ::visit , EMPTY_TOKEN ));
341341
342342 return builder ;
343343 }
@@ -396,6 +396,7 @@ public QueryTokenStream visitJoin(HqlParser.JoinContext ctx) {
396396
397397 QueryRendererBuilder builder = QueryRenderer .builder ();
398398
399+ builder .append (TOKEN_SPACE );
399400 builder .append (visit (ctx .joinType ()));
400401 builder .append (QueryTokens .expression (ctx .JOIN ()));
401402
@@ -753,7 +754,7 @@ public QueryTokenStream visitOffsetClause(HqlParser.OffsetClauseContext ctx) {
753754 QueryRendererBuilder builder = QueryRenderer .builder ();
754755
755756 builder .append (QueryTokens .expression (ctx .OFFSET ()));
756- builder .append (visit (ctx .parameterOrIntegerLiteral ()));
757+ builder .appendExpression (visit (ctx .parameterOrIntegerLiteral ()));
757758
758759 if (ctx .ROW () != null ) {
759760 builder .append (QueryTokens .expression (ctx .ROW ()));
@@ -3384,7 +3385,7 @@ public QueryTokenStream visitEveryFunction(HqlParser.EveryFunctionContext ctx) {
33843385 builder .append (TOKEN_CLOSE_PAREN );
33853386 } else {
33863387
3387- builder .appendExpression (visit (ctx .collectionQuantifier ()));
3388+ builder .append (visit (ctx .collectionQuantifier ()));
33883389
33893390 builder .append (TOKEN_OPEN_PAREN );
33903391 builder .appendInline (visit (ctx .simplePath ()));
@@ -3419,7 +3420,7 @@ public QueryTokenStream visitAnyFunction(HqlParser.AnyFunctionContext ctx) {
34193420 builder .append (TOKEN_CLOSE_PAREN );
34203421 } else {
34213422
3422- builder .appendExpression (visit (ctx .collectionQuantifier ()));
3423+ builder .append (visit (ctx .collectionQuantifier ()));
34233424
34243425 builder .append (TOKEN_OPEN_PAREN );
34253426 builder .appendInline (visit (ctx .simplePath ()));
@@ -3808,9 +3809,9 @@ public QueryTokenStream visitInList(HqlParser.InListContext ctx) {
38083809 if (ctx .simplePath () != null ) {
38093810
38103811 if (ctx .ELEMENTS () != null ) {
3811- builder .append (QueryTokens .expression (ctx .ELEMENTS ()));
3812+ builder .append (QueryTokens .token (ctx .ELEMENTS ()));
38123813 } else if (ctx .INDICES () != null ) {
3813- builder .append (QueryTokens .expression (ctx .INDICES ()));
3814+ builder .append (QueryTokens .token (ctx .INDICES ()));
38143815 }
38153816
38163817 builder .append (TOKEN_OPEN_PAREN );
@@ -3843,9 +3844,9 @@ public QueryTokenStream visitExistsExpression(HqlParser.ExistsExpressionContext
38433844 builder .append (QueryTokens .expression (ctx .EXISTS ()));
38443845
38453846 if (ctx .ELEMENTS () != null ) {
3846- builder .append (QueryTokens .expression (ctx .ELEMENTS ()));
3847+ builder .append (QueryTokens .token (ctx .ELEMENTS ()));
38473848 } else if (ctx .INDICES () != null ) {
3848- builder .append (QueryTokens .expression (ctx .INDICES ()));
3849+ builder .append (QueryTokens .token (ctx .INDICES ()));
38493850 }
38503851
38513852 builder .append (TOKEN_OPEN_PAREN );
0 commit comments