All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.query.criteria.internal.OrderImpl Maven / Gradle / Ivy

There is a newer version: 6.5.0.CR2
Show newest version
/*
 * 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.query.criteria.internal;
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 - 2024 Weber Informatics LLC | Privacy Policy