File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change 29
29
/**
30
30
* An ANTLR {@link org.antlr.v4.runtime.tree.ParseTreeVisitor} that renders an HQL query without making any changes.
31
31
*
32
+ * @author TaeHyun Kang(polyglot-k)
32
33
* @author Greg Turnquist
33
34
* @author Christoph Strobl
34
35
* @since 3.1
@@ -43,19 +44,20 @@ class HqlQueryRenderer extends HqlBaseVisitor<QueryTokenStream> {
43
44
*/
44
45
static boolean isSubquery (ParserRuleContext ctx ) {
45
46
46
- if (ctx instanceof HqlParser . SubqueryContext || ctx instanceof HqlParser . CteContext ) {
47
- return true ;
48
- } else if ( ctx instanceof HqlParser . SelectStatementContext ) {
49
- return false ;
50
- } else if (ctx instanceof HqlParser .InsertStatementContext ) {
51
- return false ;
52
- } else if ( ctx instanceof HqlParser .DeleteStatementContext ) {
53
- return false ;
54
- } else if ( ctx instanceof HqlParser . UpdateStatementContext ) {
55
- return false ;
56
- } else {
57
- return ctx . getParent () != null && isSubquery ( ctx .getParent () );
47
+ while (ctx != null ) {
48
+ if ( ctx instanceof HqlParser . SubqueryContext || ctx instanceof HqlParser . CteContext ) {
49
+ return true ;
50
+ }
51
+ if (ctx instanceof HqlParser .SelectStatementContext ||
52
+ ctx instanceof HqlParser . InsertStatementContext ||
53
+ ctx instanceof HqlParser .DeleteStatementContext ||
54
+ ctx instanceof HqlParser . UpdateStatementContext
55
+ ) {
56
+ return false ;
57
+ }
58
+ ctx = ctx .getParent ();
58
59
}
60
+ return false ;
59
61
}
60
62
61
63
@ Override
You can’t perform that action at this time.
0 commit comments