org.ibatis.persist.impl.OrderImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbatis Show documentation
Show all versions of jbatis Show documentation
The jBATIS persistence framework will help you to significantly reduce the amount of Java code that you normally need to access a relational database. iBATIS simply maps JavaBeans to SQL statements using a very simple XML descriptor.
The newest version!
package org.ibatis.persist.impl;
import org.ibatis.persist.criteria.Expression;
import org.ibatis.persist.criteria.Order;
/**
* Represents an ORDER BY fragment.
*/
public class OrderImpl implements Order {
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;
}
}