
org.hibernate.jpa.criteria.OrderImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-entitymanager
Show all versions of hibernate-entitymanager
A module of the Hibernate O/RM project
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.jpa.criteria;
import java.io.Serializable;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Order;
/**
* Represents an ORDER BY fragment.
*
* @author Steve Ebersole
*/
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;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy