Documented descending ordering by index

This commit is contained in:
Lukas Eder 2012-03-03 13:17:29 +00:00
parent eb7f140ece
commit e914d2d037
3 changed files with 19 additions and 6 deletions

View File

@ -84,6 +84,10 @@ public interface OrderProvider {
* Adds ordering fields
* <p>
* Indexes start at <code>1</code> in SQL!
* <p>
* Note, you can use <code>addOrderBy(Factory.val(1).desc())</code> or
* <code>addOrderBy(Factory.literal(1).desc())</code> to apply descending
* ordering
*
* @param fieldIndexes The ordering fields
*/
@ -108,8 +112,9 @@ public interface OrderProvider {
* <p>
* If there is no <code>LIMIT</code> or <code>TOP</code> clause in your
* RDBMS, or the <code>LIMIT</code> or <code>TOP</code> clause does not
* support bind values, this may be simulated with a <code>ROW_NUMBER()</code>
* window function and nested <code>SELECT</code> statements.
* support bind values, this may be simulated with a
* <code>ROW_NUMBER()</code> window function and nested <code>SELECT</code>
* statements.
* <p>
* This is the same as calling {@link #addLimit(int, int)} with offset = 0
*
@ -144,8 +149,8 @@ public interface OrderProvider {
* If there is no <code>LIMIT</code> or <code>TOP</code> clause in your
* RDBMS, or the <code>LIMIT</code> or <code>TOP</code> clause does not
* support bind values, or if your RDBMS does not natively support offsets,
* this may be simulated with a <code>ROW_NUMBER()</code> window function and
* nested <code>SELECT</code> statements.
* this may be simulated with a <code>ROW_NUMBER()</code> window function
* and nested <code>SELECT</code> statements.
*
* @param offset The lowest offset starting at 0
* @param numberOfRows The number of rows to return
@ -162,8 +167,8 @@ public interface OrderProvider {
* If there is no <code>LIMIT</code> or <code>TOP</code> clause in your
* RDBMS, or the <code>LIMIT</code> or <code>TOP</code> clause does not
* support bind values, or if your RDBMS does not natively support offsets,
* this may be simulated with a <code>ROW_NUMBER()</code> window function and
* nested <code>SELECT</code> statements.
* this may be simulated with a <code>ROW_NUMBER()</code> window function
* and nested <code>SELECT</code> statements.
*
* @param offset The lowest offset starting at 0
* @param numberOfRows The number of rows to return

View File

@ -103,6 +103,10 @@ public interface SelectOrderByStep extends SelectLimitStep {
* Add an <code>ORDER BY</code> clause to the query
* <p>
* Indexes start at <code>1</code> in SQL!
* <p>
* Note, you can use <code>orderBy(Factory.val(1).desc())</code> or
* <code>orderBy(Factory.literal(1).desc())</code> to apply descending
* ordering
*/
@Support
SelectLimitStep orderBy(int... fieldIndexes);

View File

@ -80,6 +80,10 @@ public interface SimpleSelectOrderByStep<R extends Record> extends SimpleSelectL
* Add an <code>ORDER BY</code> clause to the query
* <p>
* Indexes start at <code>1</code> in SQL!
* <p>
* Note, you can use <code>orderBy(Factory.val(1).desc())</code> or
* <code>orderBy(Factory.literal(1).desc())</code> to apply descending
* ordering
*/
@Support
SimpleSelectLimitStep<R> orderBy(int... fieldIndexes);