org.jooq
Interface SelectQuery

All Superinterfaces:
Adapter, Attachable, ConditionProvider, FieldLike, FieldProvider, LockProvider, OrderProvider, Query, QueryPart, ResultQuery<Record>, Select<Record>, Serializable, TableLike<Record>

public interface SelectQuery
extends Select<Record>, ConditionProvider, OrderProvider, LockProvider

A query for data selection

Author:
Lukas Eder

Method Summary
 void addConnectBy(Condition condition)
          Add an Oracle-specific CONNECT BY clause to the query
 void addConnectByNoCycle(Condition condition)
          Add an Oracle-specific CONNECT BY NOCYCLE clause to the query
 void addFrom(Collection<? extends TableLike<?>> from)
          Add tables to the table product
 void addFrom(TableLike<?>... from)
          Add tables to the table product
 void addGroupBy(Collection<? extends Field<?>> fields)
          Adds grouping fields
 void addGroupBy(Field<?>... fields)
          Adds grouping fields
 void addHaving(Collection<Condition> conditions)
          Adds new conditions to the having clause of the query, connecting it to existing conditions with the and operator.
 void addHaving(Condition... conditions)
          Adds new conditions to the having clause of the query, connecting it to existing conditions with the and operator.
 void addHaving(Operator operator, Collection<Condition> conditions)
          Adds new conditions to the having clause of query, connecting them to existing conditions with the provided operator
 void addHaving(Operator operator, Condition... conditions)
          Adds new conditions to the having clause of query, connecting them to existing conditions with the provided operator
 void addHint(String hint)
          Add an Oracle-style hint to the select clause Example: Factory create = new Factory(); create.select(field1, field2) .hint("/*+ALL_ROWS*/") .from(table1) .execute();
 void addJoin(TableLike<?> table, Condition... conditions)
          Joins the existing table product to a new table using a condition
 void addJoin(TableLike<?> table, JoinType type, Condition... conditions)
          Joins the existing table product to a new table using a condition
 void addJoinOnKey(TableLike<?> table, JoinType type)
          Joins the existing table product to a new table using a foreign key
 void addJoinOnKey(TableLike<?> table, JoinType type, ForeignKey<?,?> key)
          Joins the existing table product to a new table using a foreign key
 void addJoinOnKey(TableLike<?> table, JoinType type, TableField<?,?>... keyFields)
          Joins the existing table product to a new table using a foreign key
 void addJoinUsing(TableLike<?> table, Collection<? extends Field<?>> fields)
          Joins the existing table product to a new table with a USING clause If this is not supported by your RDBMS, then jOOQ will try to simulate this behaviour using the information provided in this query.
 void addJoinUsing(TableLike<?> table, JoinType type, Collection<? extends Field<?>> fields)
          Joins the existing table product to a new table with a USING clause If this is not supported by your RDBMS, then jOOQ will try to simulate this behaviour using the information provided in this query.
 void addSelect(Collection<? extends Field<?>> fields)
          Add a list of select fields
 void addSelect(Field<?>... fields)
          Add a list of select fields
 void setConnectByStartWith(Condition condition)
          Add an Oracle-specific START WITH clause to the query's CONNECT BY clause
 void setDistinct(boolean distinct)
          Add "distinct" keyword to the select clause
 
Methods inherited from interface org.jooq.Select
except, getSelect, intersect, union, unionAll
 
Methods inherited from interface org.jooq.ResultQuery
bind, bind, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetchAny, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArrays, fetchInto, fetchInto, fetchInto, fetchLater, fetchLater, fetchLazy, fetchLazy, fetchMany, fetchMap, fetchMap, fetchMaps, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOneArray, fetchOneMap, fetchResultSet, getRecordType, getResult
 
Methods inherited from interface org.jooq.Query
execute, getBindValues, getParam, getParams, getSQL, getSQL
 
Methods inherited from interface org.jooq.Attachable
attach
 
Methods inherited from interface org.jooq.Adapter
internalAPI
 
Methods inherited from interface org.jooq.TableLike
asTable, asTable
 
Methods inherited from interface org.jooq.FieldLike
asField, asField
 
Methods inherited from interface org.jooq.FieldProvider
getField, getField, getField, getFields, getIndex
 
Methods inherited from interface org.jooq.ConditionProvider
addConditions, addConditions, addConditions, addConditions
 
Methods inherited from interface org.jooq.OrderProvider
addLimit, addLimit, addLimit, addLimit, addLimit, addLimit, addOrderBy, addOrderBy, addOrderBy, addOrderBy
 
Methods inherited from interface org.jooq.LockProvider
setForShare, setForUpdate, setForUpdateNoWait, setForUpdateOf, setForUpdateOf, setForUpdateOf, setForUpdateSkipLocked, setForUpdateWait
 

Method Detail

addSelect

void addSelect(Field<?>... fields)
Add a list of select fields

Parameters:
fields -

addSelect

void addSelect(Collection<? extends Field<?>> fields)
Add a list of select fields

Parameters:
fields -

setDistinct

void setDistinct(boolean distinct)
Add "distinct" keyword to the select clause


addFrom

void addFrom(TableLike<?>... from)
Add tables to the table product

Parameters:
from - The added tables

addFrom

void addFrom(Collection<? extends TableLike<?>> from)
Add tables to the table product

Parameters:
from - The added tables

addJoin

void addJoin(TableLike<?> table,
             Condition... conditions)
Joins the existing table product to a new table using a condition

Parameters:
table - The joined table
conditions - The joining conditions

addJoin

void addJoin(TableLike<?> table,
             JoinType type,
             Condition... conditions)
Joins the existing table product to a new table using a condition

Parameters:
table - The joined table
type - The type of join
conditions - The joining conditions

addJoinUsing

void addJoinUsing(TableLike<?> table,
                  Collection<? extends Field<?>> fields)
Joins the existing table product to a new table with a USING clause

If this is not supported by your RDBMS, then jOOQ will try to simulate this behaviour using the information provided in this query.

Parameters:
table - The joined table
fields - The fields for the USING clause

addJoinUsing

void addJoinUsing(TableLike<?> table,
                  JoinType type,
                  Collection<? extends Field<?>> fields)
Joins the existing table product to a new table with a USING clause

If this is not supported by your RDBMS, then jOOQ will try to simulate this behaviour using the information provided in this query.

Parameters:
table - The joined table
type - The type of join
fields - The fields for the USING clause

addJoinOnKey

void addJoinOnKey(TableLike<?> table,
                  JoinType type)
                  throws DataAccessException
Joins the existing table product to a new table using a foreign key

Parameters:
table - The joined table
type - The type of join
Throws:
DataAccessException - If there is no non-ambiguous key definition known to jOOQ
See Also:
TableOnStep.onKey(ForeignKey)

addJoinOnKey

void addJoinOnKey(TableLike<?> table,
                  JoinType type,
                  TableField<?,?>... keyFields)
                  throws DataAccessException
Joins the existing table product to a new table using a foreign key

Parameters:
table - The joined table
type - The type of join
keyFields - The foreign key fields
Throws:
DataAccessException - If there is no non-ambiguous key definition known to jOOQ
See Also:
TableOnStep.onKey(ForeignKey)

addJoinOnKey

void addJoinOnKey(TableLike<?> table,
                  JoinType type,
                  ForeignKey<?,?> key)
Joins the existing table product to a new table using a foreign key

Parameters:
table - The joined table
type - The type of join
key - The foreign key
See Also:
TableOnStep.onKey(ForeignKey)

addGroupBy

void addGroupBy(Field<?>... fields)
Adds grouping fields

Parameters:
fields - The grouping fields

addGroupBy

void addGroupBy(Collection<? extends Field<?>> fields)
Adds grouping fields

Parameters:
fields - The grouping fields

addHaving

void addHaving(Condition... conditions)
Adds new conditions to the having clause of the query, connecting it to existing conditions with the and operator.

Parameters:
conditions - The condition

addHaving

void addHaving(Collection<Condition> conditions)
Adds new conditions to the having clause of the query, connecting it to existing conditions with the and operator.

Parameters:
conditions - The condition

addHaving

void addHaving(Operator operator,
               Condition... conditions)
Adds new conditions to the having clause of query, connecting them to existing conditions with the provided operator

Parameters:
operator - The operator to use to add the conditions to the existing conditions
conditions - The condition

addHaving

void addHaving(Operator operator,
               Collection<Condition> conditions)
Adds new conditions to the having clause of query, connecting them to existing conditions with the provided operator

Parameters:
operator - The operator to use to add the conditions to the existing conditions
conditions - The condition

addHint

void addHint(String hint)
Add an Oracle-style hint to the select clause

Example:

 Factory create = new Factory();

 create.select(field1, field2)
       .hint("/*+ALL_ROWS*/")
       .from(table1)
       .execute();
 


addConnectBy

void addConnectBy(Condition condition)
Add an Oracle-specific CONNECT BY clause to the query


addConnectByNoCycle

void addConnectByNoCycle(Condition condition)
Add an Oracle-specific CONNECT BY NOCYCLE clause to the query


setConnectByStartWith

void setConnectByStartWith(Condition condition)
Add an Oracle-specific START WITH clause to the query's CONNECT BY clause



Copyright © 2012. All Rights Reserved.