package org.hibernate.query.criteria.internal;
import java.io.Serializable;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Order;
public class OrderImpl implements Order, Serializable {
private final Expression<?> expression;
private boolean ascending;
public OrderImpl(Expression<?> expression) {
this( expression, true );
}
public OrderImpl(Expression<?> expression, boolean ascending) {
this.expression = expression;
this.ascending = ascending;
}
public Order reverse() {
ascending = !ascending;
return this;
}
public boolean isAscending() {
return ascending;
}
public Expression<?> getExpression() {
return expression;
}
}