15
15
*/
16
16
package org .springframework .data .jpa .repository .query ;
17
17
18
- import static org .springframework .data .repository .query .parser .Part .Type .IS_NOT_EMPTY ;
19
- import static org .springframework .data .repository .query .parser .Part .Type .NOT_CONTAINING ;
20
- import static org .springframework .data .repository .query .parser .Part .Type .NOT_LIKE ;
21
- import static org .springframework .data .repository .query .parser .Part .Type .SIMPLE_PROPERTY ;
18
+ import static org .springframework .data .repository .query .parser .Part .Type .*;
22
19
23
20
import jakarta .persistence .EntityManager ;
24
21
import jakarta .persistence .criteria .CriteriaQuery ;
39
36
import org .springframework .data .domain .Sort ;
40
37
import org .springframework .data .jpa .domain .JpaSort ;
41
38
import org .springframework .data .jpa .repository .query .JpqlQueryBuilder .ParameterPlaceholder ;
42
- import org .springframework .data .jpa .repository .query .JpqlQueryBuilder .PathAndOrigin ;
43
39
import org .springframework .data .jpa .repository .query .ParameterBinding .PartTreeParameterBinding ;
44
40
import org .springframework .data .jpa .repository .support .JpqlQueryTemplates ;
45
41
import org .springframework .data .mapping .PropertyPath ;
@@ -182,8 +178,8 @@ protected JpqlQueryBuilder.Select buildQuery(Sort sort) {
182
178
QueryUtils .checkSortExpression (order );
183
179
184
180
try {
185
- expression = JpqlQueryBuilder . expression ( JpqlUtils .toExpressionRecursively (metamodel , entity , entityType ,
186
- PropertyPath .from (order .getProperty (), entityType .getJavaType ()))) ;
181
+ expression = JpqlUtils .toExpressionRecursively (metamodel , entity , entityType ,
182
+ PropertyPath .from (order .getProperty (), entityType .getJavaType ()));
187
183
} catch (PropertyReferenceException e ) {
188
184
189
185
if (order instanceof JpaSort .JpaOrder jpaOrder && jpaOrder .isUnsafe ()) {
@@ -226,7 +222,7 @@ private JpqlQueryBuilder.Select doSelect(Sort sort) {
226
222
requiredSelection = getRequiredSelection (sort , returnedType );
227
223
}
228
224
229
- List <PathAndOrigin > paths = new ArrayList <>(requiredSelection .size ());
225
+ List <JpqlQueryBuilder . PathExpression > paths = new ArrayList <>(requiredSelection .size ());
230
226
for (String selection : requiredSelection ) {
231
227
paths .add (JpqlUtils .toExpressionRecursively (metamodel , entity , entityType ,
232
228
PropertyPath .from (selection , returnedType .getDomainType ()), true ));
@@ -250,7 +246,7 @@ private JpqlQueryBuilder.Select doSelect(Sort sort) {
250
246
251
247
} else {
252
248
253
- List <PathAndOrigin > paths = entityType .getIdClassAttributes ().stream ()//
249
+ List <JpqlQueryBuilder . PathExpression > paths = entityType .getIdClassAttributes ().stream ()//
254
250
.map (it -> JpqlUtils .toExpressionRecursively (metamodel , entity , entityType ,
255
251
PropertyPath .from (it .getName (), returnedType .getDomainType ()), true ))
256
252
.toList ();
@@ -319,7 +315,7 @@ public JpqlQueryBuilder.Predicate build() {
319
315
PropertyPath property = part .getProperty ();
320
316
Type type = part .getType ();
321
317
322
- PathAndOrigin pas = JpqlUtils .toExpressionRecursively (metamodel , entity , entityType , property );
318
+ JpqlQueryBuilder . PathExpression pas = JpqlUtils .toExpressionRecursively (metamodel , entity , entityType , property );
323
319
JpqlQueryBuilder .WhereStep where = JpqlQueryBuilder .where (pas );
324
320
JpqlQueryBuilder .WhereStep whereIgnoreCase = JpqlQueryBuilder .where (potentiallyIgnoreCase (pas ));
325
321
@@ -419,8 +415,8 @@ private <T> JpqlQueryBuilder.Expression potentiallyIgnoreCase(JpqlQueryBuilder.O
419
415
* @param path must not be {@literal null}.
420
416
* @return
421
417
*/
422
- private <T > JpqlQueryBuilder .Expression potentiallyIgnoreCase (PathAndOrigin path ) {
423
- return potentiallyIgnoreCase (path .path (), JpqlQueryBuilder . expression ( path ) );
418
+ private <T > JpqlQueryBuilder .Expression potentiallyIgnoreCase (JpqlQueryBuilder . PathExpression path ) {
419
+ return potentiallyIgnoreCase (path .getPropertyPath (), path );
424
420
}
425
421
426
422
/**
0 commit comments