Order by random. Probably this isn't very optimal.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2096 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -25,6 +25,7 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
import com.samskivert.jdbc.depot.ConstructedQuery;
|
import com.samskivert.jdbc.depot.ConstructedQuery;
|
||||||
import com.samskivert.jdbc.depot.expression.ColumnExp;
|
import com.samskivert.jdbc.depot.expression.ColumnExp;
|
||||||
|
import com.samskivert.jdbc.depot.expression.LiteralExp;
|
||||||
import com.samskivert.jdbc.depot.expression.SQLExpression;
|
import com.samskivert.jdbc.depot.expression.SQLExpression;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,6 +36,14 @@ public class OrderBy extends QueryClause
|
|||||||
/** Indicates the order of the clause. */
|
/** Indicates the order of the clause. */
|
||||||
public enum Order { ASC, DESC };
|
public enum Order { ASC, DESC };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates and returns a random order by clause.
|
||||||
|
*/
|
||||||
|
public static OrderBy random ()
|
||||||
|
{
|
||||||
|
return ascending(new LiteralExp("rand()"));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns an ascending order by clause on the supplied column.
|
* Creates and returns an ascending order by clause on the supplied column.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user