1515 */
1616package org .springframework .data .jpa .domain ;
1717
18+ import jakarta .persistence .metamodel .Attribute ;
19+ import jakarta .persistence .metamodel .PluralAttribute ;
20+
1821import java .util .ArrayList ;
1922import java .util .Arrays ;
2023import java .util .Collection ;
2124import java .util .Collections ;
2225import java .util .List ;
2326
24- import jakarta .persistence .metamodel .Attribute ;
25- import jakarta .persistence .metamodel .PluralAttribute ;
26-
2727import org .springframework .data .domain .Sort ;
2828import org .springframework .lang .Nullable ;
2929import org .springframework .util .Assert ;
@@ -364,7 +364,6 @@ public static class JpaOrder extends Order {
364364 private static final long serialVersionUID = 1L ;
365365
366366 private final boolean unsafe ;
367- private final boolean ignoreCase ;
368367
369368 /**
370369 * 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) {
386385 * @param nullHandlingHint can be {@literal null}, will default to {@link NullHandling#NATIVE}.
387386 */
388387 private JpaOrder (@ Nullable Direction direction , String property , NullHandling nullHandlingHint ) {
389- this (direction , property , nullHandlingHint , false , true );
388+ this (direction , property , false , nullHandlingHint , true );
390389 }
391390
392- private JpaOrder (@ Nullable Direction direction , String property , NullHandling nullHandling , boolean ignoreCase ,
391+ private JpaOrder (@ Nullable Direction direction , String property , boolean ignoreCase , NullHandling nullHandling ,
393392 boolean unsafe ) {
394393
395- super (direction , property , nullHandling );
396- this .ignoreCase = ignoreCase ;
394+ super (direction , property , ignoreCase , nullHandling );
397395 this .unsafe = unsafe ;
398396 }
399397
400398 @ Override
401399 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 );
403401 }
404402
405403 @ Override
406404 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 );
408406 }
409407
410408 /**
@@ -421,20 +419,15 @@ public Sort withUnsafe(String... properties) {
421419 List <Order > orders = new ArrayList <>(properties .length );
422420
423421 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 ));
425423 }
426424
427425 return Sort .by (orders );
428426 }
429427
430428 @ Override
431429 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 );
438431 }
439432
440433 /**
0 commit comments