Provide a concise way to create ascending and descending order by clauses.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1985 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2006-11-29 02:24:21 +00:00
parent 7ec88a15ff
commit 1d6ab3cc03
@@ -33,6 +33,26 @@ import com.samskivert.jdbc.depot.expression.SQLExpression;
public class OrderBy
implements QueryClause
{
/**
* Creates and returns an ascending order by clause on the supplied expressions.
*/
public static OrderBy ascending (SQLExpression... values)
{
OrderBy clause = new OrderBy(values);
clause._ascending = true;
return clause;
}
/**
* Creates and returns a descending order by clause on the supplied expressions.
*/
public static OrderBy descending (SQLExpression... values)
{
OrderBy clause = new OrderBy(values);
clause._ascending = false;
return clause;
}
public OrderBy (SQLExpression... values)
{
_values = values;