15
15
*/
16
16
package org .springframework .data .jpa .repository .query ;
17
17
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 .*;
21
20
22
21
import net .sf .jsqlparser .expression .Alias ;
23
22
import net .sf .jsqlparser .expression .Expression ;
75
74
public class JSqlParserQueryEnhancer implements QueryEnhancer {
76
75
77
76
private final QueryProvider query ;
78
- private final Statement statement ;
79
77
private final ParsedType parsedType ;
80
78
private final boolean hasConstructorExpression ;
81
79
private final @ Nullable String primaryAlias ;
@@ -90,15 +88,15 @@ public class JSqlParserQueryEnhancer implements QueryEnhancer {
90
88
public JSqlParserQueryEnhancer (QueryProvider query ) {
91
89
92
90
this .query = query ;
93
- this . statement = parseStatement (query .getQueryString (), Statement .class );
91
+ Statement statement = parseStatement (query .getQueryString (), Statement .class );
94
92
95
93
this .parsedType = detectParsedType (statement );
96
94
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 );
102
100
}
103
101
104
102
/**
@@ -217,8 +215,8 @@ private static Set<String> getJoinAliases(Statement statement) {
217
215
* @param statement
218
216
* @param mapper
219
217
* @param fallback
220
- * @return
221
218
* @param <T>
219
+ * @return
222
220
*/
223
221
private static <T > T doWithPlainSelect (Statement statement , java .util .function .Function <PlainSelect , T > mapper ,
224
222
Supplier <T > fallback ) {
@@ -238,8 +236,8 @@ private static <T> T doWithPlainSelect(Statement statement, java.util.function.F
238
236
* @param skipIf
239
237
* @param mapper
240
238
* @param fallback
241
- * @return
242
239
* @param <T>
240
+ * @return
243
241
*/
244
242
private static <T > T doWithPlainSelect (Statement statement , Predicate <PlainSelect > skipIf ,
245
243
java .util .function .Function <PlainSelect , T > mapper , Supplier <T > fallback ) {
0 commit comments