Class JpaSort.JpaOrder
java.lang.Object
org.springframework.data.domain.Sort.Order
org.springframework.data.jpa.domain.JpaSort.JpaOrder
- All Implemented Interfaces:
Serializable
- Enclosing class:
JpaSort
Custom
Sort.Order that keeps a flag to indicate unsafe property handling, i.e. the String provided is not
necessarily a property but can be an arbitrary expression piped into the query execution. We also keep an
additional ignoreCase flag around as the constructor of the superclass is private currently.- Author:
- Christoph Strobl, Oliver Gierke
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic JpaSort.JpaOrderCreates a newJpaOrderinstance.static <T,P> JpaSort.JpaOrder asc(TypedPropertyPath<T, P> propertyPath) Creates a newJpaOrderinstance.static JpaSort.JpaOrderCreates a newJpaOrderinstance.static JpaSort.JpaOrderCreates a newJpaOrderinstance.static <T,P> JpaSort.JpaOrder desc(TypedPropertyPath<T, P> propertyPath) Creates a newJpaOrderinstance.booleanisUnsafe()with(Sort.Direction order) with(Sort.NullHandling nullHandling) withUnsafe(String... properties) Creates newJpaSortwith potentially unsafeSort.Orderinstances.Methods inherited from class Sort.Order
by, equals, getDirection, getNullHandling, getProperty, hashCode, isAscending, isDescending, isIgnoreCase, nullsFirst, nullsLast, nullsNative, reverse, toString, withProperties, withProperties, withProperty, withProperty
-
Method Details
-
by
Creates a newJpaOrderinstance. Takes a single property. Direction defaults toSort.DEFAULT_DIRECTION.- Parameters:
property- must not be null or empty.- Since:
- 4.1
-
asc
Creates a newJpaOrderinstance. Takes a property path. Direction isSort.Direction.ASCand NullHandlingSort.NullHandling.NATIVE.- Parameters:
propertyPath- must not be null or empty.- Since:
- 4.1
-
asc
Creates a newJpaOrderinstance. Takes a single property. Direction isSort.Direction.ASCand NullHandlingSort.NullHandling.NATIVE.- Parameters:
property- must not be null or empty.- Since:
- 4.1
-
desc
Creates a newJpaOrderinstance. Takes a property path. Direction isSort.Direction.DESCand NullHandlingSort.NullHandling.NATIVE.- Parameters:
propertyPath- must not be null or empty.- Since:
- 4.1
-
desc
Creates a newJpaOrderinstance. Takes a single property. Direction isSort.Direction.DESCand NullHandlingSort.NullHandling.NATIVE.- Parameters:
property- must not be null or empty.- Since:
- 4.1
-
with
- Overrides:
within classSort.Order
-
with
- Overrides:
within classSort.Order
-
withUnsafe
Creates newJpaSortwith potentially unsafeSort.Orderinstances.The returned
JpaSortapplies the current direction, case-sensitivity, and null-handling settings for all givenproperties.- Parameters:
properties- must not be null.- Returns:
-
ignoreCase
- Overrides:
ignoreCasein classSort.Order
-
isUnsafe
public boolean isUnsafe()- Returns:
- true if
JpaSort.JpaOrdercreatedwithUnsafe(String...).
-