Class OrderByField
java.lang.Object
org.springframework.data.relational.core.sql.OrderByField
Represents a field in the
ORDER BY clause.- Since:
- 1.1
- Author:
- Mark Paluch, Milan Milanov
-
Method Summary
Modifier and TypeMethodDescriptionasc()Creates a newOrderByFieldfrom a the current one using ascending sorting.desc()Creates a newOrderByFieldfrom a the current one using descending sorting.booleanstatic OrderByFieldfrom(Expression expression) Creates a newOrderByFieldfrom anExpressionapplying default ordering.static OrderByFieldfrom(Expression expression, Sort.Direction direction) Creates a newOrderByFieldfrom anExpressionapplying a given ordering.@Nullable Sort.DirectioninthashCode()Generate a hash code from thisSegment.toString()Return a SQL string representation of thisSegment.voidwithNullHandling(Sort.NullHandling nullHandling) Creates a newOrderByFieldwithSort.NullHandlingapplied.
-
Method Details
-
from
Creates a newOrderByFieldfrom anExpressionapplying default ordering.- Parameters:
expression- must not be null.- Returns:
- the
OrderByField.
-
from
Creates a newOrderByFieldfrom anExpressionapplying a given ordering.- Parameters:
expression- must not be null.direction- order direction- Returns:
- the
OrderByField.
-
asc
Creates a newOrderByFieldfrom a the current one using ascending sorting.- Returns:
- the new
OrderByFieldwith ascending sorting. - See Also:
-
desc
Creates a newOrderByFieldfrom a the current one using descending sorting.- Returns:
- the new
OrderByFieldwith descending sorting. - See Also:
-
withNullHandling
Creates a newOrderByFieldwithSort.NullHandlingapplied.- Parameters:
nullHandling- must not be null.- Returns:
- the new
OrderByFieldwithSort.NullHandlingapplied.
-
getExpression
-
getDirection
-
getNullHandling
-
toString
Description copied from interface:SegmentReturn a SQL string representation of thisSegment.The representation is intended for debugging purposes and an approximation to the generated SQL. While it might work in the context of a specific dialect, you should not assume that the
Segment.toString()representation works across multiple databases. -
visit
Description copied from interface:Visitable -
hashCode
public int hashCode()Description copied from interface:SegmentGenerate a hash code from thisSegment.Hashcode typically derives from the
Segment.toString()representation so twoSegments yield the sameSegment.hashCode()if theirSegment.toString()representation matches. -
equals
Description copied from interface:SegmentCheck whether thisSegmentis equal to anotherSegment.Equality is typically given if the
Segment.toString()representation matches.
-