File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 2929/**
3030 * An ANTLR {@link org.antlr.v4.runtime.tree.ParseTreeVisitor} that renders an HQL query without making any changes.
3131 *
32- * @author TaeHyun Kang(polyglot-k)
3332 * @author Greg Turnquist
3433 * @author Christoph Strobl
34+ * @author Mark Paluch
35+ * @author TaeHyun Kang
3536 * @since 3.1
3637 */
3738@ SuppressWarnings ({ "ConstantConditions" , "DuplicatedCode" , "UnreachableCode" })
@@ -40,23 +41,26 @@ class HqlQueryRenderer extends HqlBaseVisitor<QueryTokenStream> {
4041 /**
4142 * Is this select clause a {@literal subquery}?
4243 *
43- * @return boolean
44+ * @return {@literal true} is the query is a subquery; {@literal false} otherwise.
4445 */
4546 static boolean isSubquery (ParserRuleContext ctx ) {
4647
4748 while (ctx != null ) {
49+
4850 if (ctx instanceof HqlParser .SubqueryContext || ctx instanceof HqlParser .CteContext ) {
4951 return true ;
5052 }
53+
5154 if (ctx instanceof HqlParser .SelectStatementContext ||
5255 ctx instanceof HqlParser .InsertStatementContext ||
5356 ctx instanceof HqlParser .DeleteStatementContext ||
54- ctx instanceof HqlParser .UpdateStatementContext
55- ) {
57+ ctx instanceof HqlParser .UpdateStatementContext ) {
5658 return false ;
5759 }
60+
5861 ctx = ctx .getParent ();
5962 }
63+
6064 return false ;
6165 }
6266
You can’t perform that action at this time.
0 commit comments