1515 */
1616package org .springframework .data .jpa .repository .query ;
1717
18- import static org .springframework .data .jpa .repository .query .JSqlParserUtils .getJSqlCount ;
19- import static org .springframework .data .jpa .repository .query .JSqlParserUtils .getJSqlLower ;
20- import static org .springframework .data .jpa .repository .query .QueryUtils .checkSortExpression ;
18+ import static org .springframework .data .jpa .repository .query .JSqlParserUtils .*;
19+ import static org .springframework .data .jpa .repository .query .QueryUtils .*;
2120
2221import net .sf .jsqlparser .expression .Alias ;
2322import net .sf .jsqlparser .expression .Expression ;
7574public class JSqlParserQueryEnhancer implements QueryEnhancer {
7675
7776 private final QueryProvider query ;
78- private final Statement statement ;
7977 private final ParsedType parsedType ;
8078 private final boolean hasConstructorExpression ;
8179 private final @ Nullable String primaryAlias ;
@@ -90,15 +88,15 @@ public class JSqlParserQueryEnhancer implements QueryEnhancer {
9088 public JSqlParserQueryEnhancer (QueryProvider query ) {
9189
9290 this .query = query ;
93- this . statement = parseStatement (query .getQueryString (), Statement .class );
91+ Statement statement = parseStatement (query .getQueryString (), Statement .class );
9492
9593 this .parsedType = detectParsedType (statement );
9694 this .hasConstructorExpression = QueryUtils .hasConstructorExpression (query .getQueryString ());
97- this .primaryAlias = detectAlias (this .parsedType , this . statement );
98- this .projection = detectProjection (this . statement );
99- this .selectAliases = Collections .unmodifiableSet (getSelectionAliases (this . statement ));
100- this .joinAliases = Collections .unmodifiableSet (getJoinAliases (this . statement ));
101- this .serialized = SerializationUtils .serialize (this . statement );
95+ this .primaryAlias = detectAlias (this .parsedType , statement );
96+ this .projection = detectProjection (statement );
97+ this .selectAliases = Collections .unmodifiableSet (getSelectionAliases (statement ));
98+ this .joinAliases = Collections .unmodifiableSet (getJoinAliases (statement ));
99+ this .serialized = SerializationUtils .serialize (statement );
102100 }
103101
104102 /**
@@ -217,8 +215,8 @@ private static Set<String> getJoinAliases(Statement statement) {
217215 * @param statement
218216 * @param mapper
219217 * @param fallback
220- * @return
221218 * @param <T>
219+ * @return
222220 */
223221 private static <T > T doWithPlainSelect (Statement statement , java .util .function .Function <PlainSelect , T > mapper ,
224222 Supplier <T > fallback ) {
@@ -238,8 +236,8 @@ private static <T> T doWithPlainSelect(Statement statement, java.util.function.F
238236 * @param skipIf
239237 * @param mapper
240238 * @param fallback
241- * @return
242239 * @param <T>
240+ * @return
243241 */
244242 private static <T > T doWithPlainSelect (Statement statement , Predicate <PlainSelect > skipIf ,
245243 java .util .function .Function <PlainSelect , T > mapper , Supplier <T > fallback ) {
0 commit comments