org.jooq
Interface OrderProvider

All Known Subinterfaces:
SelectQuery, SimpleSelectQuery<R>

public interface OrderProvider

A query that can be ordered and limited

Author:
Lukas Eder

Method Summary
 void addLimit(int numberOfRows)
          Limit the results of this select This is the same as calling addLimit(int, int) with offset = 0
 void addLimit(int offset, int numberOfRows)
          Limit the results of this select Note that some dialects do not support bind values at all in LIMIT or TOP clauses!
 void addLimit(int offset, Param<Integer> numberOfRows)
          Limit the results of this select using named parameters Note that some dialects do not support bind values at all in LIMIT or TOP clauses!
 void addLimit(Param<Integer> numberOfRows)
          Limit the results of this select using named parameters Note that some dialects do not support bind values at all in LIMIT or TOP clauses!
 void addLimit(Param<Integer> offset, int numberOfRows)
          Limit the results of this select Note that some dialects do not support bind values at all in LIMIT or TOP clauses!
 void addLimit(Param<Integer> offset, Param<Integer> numberOfRows)
          Limit the results of this select using named parameters Note that some dialects do not support bind values at all in LIMIT or TOP clauses!
 void addOrderBy(Collection<SortField<?>> fields)
          Adds ordering fields
 void addOrderBy(Field<?>... fields)
          Adds ordering fields, ordering by the default sort order
 void addOrderBy(int... fieldIndexes)
          Adds ordering fields Indexes start at 1 in SQL!
 void addOrderBy(SortField<?>... fields)
          Adds ordering fields
 void setOrderBySiblings(boolean orderBySiblings)
          Indicate whether the SIBLINGS keyword should be used in an ORDER BY clause to form an ORDER SIBLINGS BY clause.
 

Method Detail

addOrderBy

void addOrderBy(Field<?>... fields)
Adds ordering fields, ordering by the default sort order

Parameters:
fields - The ordering fields

addOrderBy

void addOrderBy(SortField<?>... fields)
Adds ordering fields

Parameters:
fields - The ordering fields

addOrderBy

void addOrderBy(Collection<SortField<?>> fields)
Adds ordering fields

Parameters:
fields - The ordering fields

addOrderBy

void addOrderBy(int... fieldIndexes)
Adds ordering fields

Indexes start at 1 in SQL!

Note, you can use addOrderBy(Factory.val(1).desc()) or addOrderBy(Factory.literal(1).desc()) to apply descending ordering

Parameters:
fieldIndexes - The ordering fields

setOrderBySiblings

void setOrderBySiblings(boolean orderBySiblings)
Indicate whether the SIBLINGS keyword should be used in an ORDER BY clause to form an ORDER SIBLINGS BY clause.

This clause can be used only along with Oracle's CONNECT BY clause, to indicate that the hierarchical ordering should be preserved and elements of each hierarchy should be ordered among themselves.

Parameters:
orderBySiblings -

addLimit

void addLimit(int numberOfRows)
Limit the results of this select

This is the same as calling addLimit(int, int) with offset = 0

Parameters:
numberOfRows - The number of rows to return

addLimit

void addLimit(Param<Integer> numberOfRows)
Limit the results of this select using named parameters

Note that some dialects do not support bind values at all in LIMIT or TOP clauses!

If there is no LIMIT or TOP clause in your RDBMS, or the LIMIT or TOP clause does not support bind values, this may be simulated with a ROW_NUMBER() window function and nested SELECT statements.

This is the same as calling addLimit(int, int) with offset = 0

Parameters:
numberOfRows - The number of rows to return

addLimit

void addLimit(int offset,
              int numberOfRows)
Limit the results of this select

Note that some dialects do not support bind values at all in LIMIT or TOP clauses!

If there is no LIMIT or TOP clause in your RDBMS, or if your RDBMS does not natively support offsets, this is simulated with a ROW_NUMBER() window function and nested SELECT statements.

Parameters:
offset - The lowest offset starting at 0
numberOfRows - The number of rows to return

addLimit

void addLimit(Param<Integer> offset,
              int numberOfRows)
Limit the results of this select

Note that some dialects do not support bind values at all in LIMIT or TOP clauses!

If there is no LIMIT or TOP clause in your RDBMS, or the LIMIT or TOP clause does not support bind values, or if your RDBMS does not natively support offsets, this may be simulated with a ROW_NUMBER() window function and nested SELECT statements.

Parameters:
offset - The lowest offset starting at 0
numberOfRows - The number of rows to return

addLimit

void addLimit(int offset,
              Param<Integer> numberOfRows)
Limit the results of this select using named parameters

Note that some dialects do not support bind values at all in LIMIT or TOP clauses!

If there is no LIMIT or TOP clause in your RDBMS, or the LIMIT or TOP clause does not support bind values, or if your RDBMS does not natively support offsets, this may be simulated with a ROW_NUMBER() window function and nested SELECT statements.

Parameters:
offset - The lowest offset starting at 0
numberOfRows - The number of rows to return

addLimit

void addLimit(Param<Integer> offset,
              Param<Integer> numberOfRows)
Limit the results of this select using named parameters

Note that some dialects do not support bind values at all in LIMIT or TOP clauses!

If there is no LIMIT or TOP clause in your RDBMS, or the LIMIT or TOP clause does not support bind values, or if your RDBMS does not natively support offsets, this may be simulated with a ROW_NUMBER() window function and nested SELECT statements.

Parameters:
offset - The lowest offset starting at 0
numberOfRows - The number of rows to return


Copyright © 2012. All Rights Reserved.