15
15
*/
16
16
package org .springframework .data .jpa .domain ;
17
17
18
+ import jakarta .persistence .metamodel .Attribute ;
19
+ import jakarta .persistence .metamodel .PluralAttribute ;
20
+
18
21
import java .util .ArrayList ;
19
22
import java .util .Arrays ;
20
23
import java .util .Collection ;
21
24
import java .util .Collections ;
22
25
import java .util .List ;
23
26
24
- import jakarta .persistence .metamodel .Attribute ;
25
- import jakarta .persistence .metamodel .PluralAttribute ;
26
-
27
27
import org .springframework .data .domain .Sort ;
28
28
import org .springframework .lang .Nullable ;
29
29
import org .springframework .util .Assert ;
@@ -364,7 +364,6 @@ public static class JpaOrder extends Order {
364
364
private static final long serialVersionUID = 1L ;
365
365
366
366
private final boolean unsafe ;
367
- private final boolean ignoreCase ;
368
367
369
368
/**
370
369
* Creates a new {@link JpaOrder} instance. if order is {@literal null} then order defaults to
@@ -386,25 +385,24 @@ private JpaOrder(@Nullable Direction direction, String property) {
386
385
* @param nullHandlingHint can be {@literal null}, will default to {@link NullHandling#NATIVE}.
387
386
*/
388
387
private JpaOrder (@ Nullable Direction direction , String property , NullHandling nullHandlingHint ) {
389
- this (direction , property , nullHandlingHint , false , true );
388
+ this (direction , property , false , nullHandlingHint , true );
390
389
}
391
390
392
- private JpaOrder (@ Nullable Direction direction , String property , NullHandling nullHandling , boolean ignoreCase ,
391
+ private JpaOrder (@ Nullable Direction direction , String property , boolean ignoreCase , NullHandling nullHandling ,
393
392
boolean unsafe ) {
394
393
395
- super (direction , property , nullHandling );
396
- this .ignoreCase = ignoreCase ;
394
+ super (direction , property , ignoreCase , nullHandling );
397
395
this .unsafe = unsafe ;
398
396
}
399
397
400
398
@ Override
401
399
public JpaOrder with (Direction order ) {
402
- return new JpaOrder (order , getProperty (), getNullHandling (), isIgnoreCase (), this .unsafe );
400
+ return new JpaOrder (order , getProperty (), isIgnoreCase (), getNullHandling (), this .unsafe );
403
401
}
404
402
405
403
@ Override
406
404
public JpaOrder with (NullHandling nullHandling ) {
407
- return new JpaOrder (getDirection (), getProperty (), nullHandling , isIgnoreCase (), this .unsafe );
405
+ return new JpaOrder (getDirection (), getProperty (), isIgnoreCase (), nullHandling , this .unsafe );
408
406
}
409
407
410
408
/**
@@ -421,20 +419,15 @@ public Sort withUnsafe(String... properties) {
421
419
List <Order > orders = new ArrayList <>(properties .length );
422
420
423
421
for (String property : properties ) {
424
- orders .add (new JpaOrder (getDirection (), property , getNullHandling (), isIgnoreCase (), this .unsafe ));
422
+ orders .add (new JpaOrder (getDirection (), property , isIgnoreCase (), getNullHandling (), this .unsafe ));
425
423
}
426
424
427
425
return Sort .by (orders );
428
426
}
429
427
430
428
@ Override
431
429
public JpaOrder ignoreCase () {
432
- return new JpaOrder (getDirection (), getProperty (), getNullHandling (), true , this .unsafe );
433
- }
434
-
435
- @ Override
436
- public boolean isIgnoreCase () {
437
- return super .isIgnoreCase () || ignoreCase ;
430
+ return new JpaOrder (getDirection (), getProperty (), true , getNullHandling (), this .unsafe );
438
431
}
439
432
440
433
/**
0 commit comments