HHH-16815 rename getSortOrder() -> getSortDirection()
This commit is contained in:
parent
f2d6373409
commit
7227831d56
|
@ -15,7 +15,11 @@ import org.hibernate.query.SortDirection;
|
|||
* @author Steve Ebersole
|
||||
*/
|
||||
public interface JpaOrder extends Order, JpaCriteriaNode {
|
||||
SortDirection getSortOrder();
|
||||
|
||||
/**
|
||||
* The direction, ascending or descending, in which to sort
|
||||
*/
|
||||
SortDirection getSortDirection();
|
||||
|
||||
/**
|
||||
* Set the precedence of nulls for this order element
|
||||
|
@ -31,9 +35,15 @@ public interface JpaOrder extends Order, JpaCriteriaNode {
|
|||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Covariant returns
|
||||
|
||||
/**
|
||||
* Reverse the sorting direction
|
||||
*/
|
||||
@Override
|
||||
JpaOrder reverse();
|
||||
|
||||
/**
|
||||
* The expression to sort by
|
||||
*/
|
||||
@Override
|
||||
JpaExpression<?> getExpression();
|
||||
}
|
||||
|
|
|
@ -2518,7 +2518,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
|
|||
}
|
||||
return new SortSpecification(
|
||||
expression,
|
||||
sortSpecification.getSortOrder(),
|
||||
sortSpecification.getSortDirection(),
|
||||
sortSpecification.getNullPrecedence()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -48,11 +48,12 @@ public class SqmSortSpecification implements JpaOrder {
|
|||
return new SqmSortSpecification( sortExpression.copy( context ), sortOrder, nullPrecedence );
|
||||
}
|
||||
|
||||
public SqmExpression getSortExpression() {
|
||||
public SqmExpression<?> getSortExpression() {
|
||||
return sortExpression;
|
||||
}
|
||||
|
||||
public SortDirection getSortOrder() {
|
||||
@Override
|
||||
public SortDirection getSortDirection() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ public class SortSpecificationReversalTests {
|
|||
SqmSortSpecification order = new SqmSortSpecification( sortExpression, ASCENDING, FIRST );
|
||||
|
||||
assertEquals( sortExpression, order.getSortExpression() );
|
||||
assertEquals( ASCENDING, order.getSortOrder() );
|
||||
assertEquals( ASCENDING, order.getSortDirection() );
|
||||
assertEquals( FIRST, order.getNullPrecedence() );
|
||||
|
||||
JpaOrder reversed = order.reverse();
|
||||
|
||||
assertEquals( DESCENDING, reversed.getSortOrder() );
|
||||
assertEquals( DESCENDING, reversed.getSortDirection() );
|
||||
assertEquals( FIRST, reversed.getNullPrecedence() );
|
||||
|
||||
assertNotSame( "Order.reverse() should create new instance", order, reversed );
|
||||
|
|
Loading…
Reference in New Issue