- All Superinterfaces:
Attachable,AttachableQueryPart,ConditionProvider,FieldLike,FieldOrRowOrSelect,Fields,Flow.Publisher<R>,Iterable<R>,Publisher<R>,org.reactivestreams.Publisher<R>,Query,QueryPart,ResultQuery<R>,Select<R>,Serializable,Statement,TableLike<R>
SELECT statement (model API).
This type is the model API representation of a Select statement,
which can be mutated after creation. The advantage of this API compared to
the DSL API is a more simple approach to writing dynamic SQL.
Instances can be created using DSLContext.selectQuery() and overloads.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddConditions(Collection<? extends Condition> conditions) Adds new conditions to the query, connecting them to existing conditions withOperator.AND.voidaddConditions(Condition condition) Adds a new condition to the query, connecting them to existing conditions withOperator.AND.voidaddConditions(Condition... conditions) Adds new conditions to the query, connecting them to existing conditions withOperator.AND.voidaddConditions(Operator operator, Collection<? extends Condition> conditions) Adds new conditions to the query, connecting them to existing conditions with the provided operator.voidaddConditions(Operator operator, Condition condition) Adds a new condition to the query, connecting them to existing conditions with the provided operator.voidaddConditions(Operator operator, Condition... conditions) Adds new conditions to the query, connecting them to existing conditions with the provided operator.voidaddConnectBy(Condition condition) Add an Oracle-specificCONNECT BYclause to the query.voidaddConnectByNoCycle(Condition condition) Add an Oracle-specificCONNECT BY NOCYCLEclause to the query.voidaddDistinctOn(Collection<? extends SelectFieldOrAsterisk> fields) Add a PostgreSQL-specificDISTINCT ON (fields…)clause.voidaddDistinctOn(SelectFieldOrAsterisk... fields) Add a PostgreSQL-specificDISTINCT ON (fields…)clause.voidaddFrom(Collection<? extends TableLike<?>> from) Add tables to the table product.voidAdd tables to the table product.voidAdd tables to the table product.voidaddGroupBy(Collection<? extends GroupField> fields) Adds grouping fields.voidaddGroupBy(GroupField... fields) Adds grouping fields.voidaddHaving(Collection<? extends Condition> conditions) Adds new conditions to the having clause of the query, connecting them with each other withOperator.AND.voidAdds a new condition to the having clause of the query, connecting it with each other withOperator.AND.voidAdds new conditions to the having clause of the query, connecting them with each other withOperator.AND.voidaddHaving(Operator operator, Collection<? extends Condition> conditions) Adds new conditions to the having clause of query, connecting them with each other withoperator.voidAdds a new condition to the having clause of query, connecting it with each other withoperator.voidAdds new conditions to the having clause of query, connecting them with each other withoperator.voidAdd an Oracle-style hint to the select clause.voidJoins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.voidJoins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.voidJoins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.voidJoins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.voidJoins the existing table product to a new table using conditions, connecting them with each other withOperator.AND.voidJoins the existing table product to a new table using conditions, connecting them with each other withOperator.AND.voidaddJoin(TableLike<?> table, JoinType type, QOM.JoinHint hint, Condition condition) Joins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.voidaddJoin(TableLike<?> table, JoinType type, QOM.JoinHint hint, Condition... conditions) Joins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.voidaddJoin(TableLike<?> table, JoinType type, QOM.JoinHint hint, Condition[] conditions, Field<?>[] partitionBy) Joins the existing table product to a new table using conditions, connecting them with each other withOperator.AND.voidaddJoin(TableLike<?> table, JoinType type, QOM.JoinHint hint, Condition conditions, Field<?>[] partitionBy) Joins the existing table product to a new table using conditions, connecting them with each other withOperator.AND.voidaddJoinOnKey(TableLike<?> table, JoinType type) Joins the existing table product to a new table using a foreign key.voidaddJoinOnKey(TableLike<?> table, JoinType type, ForeignKey<?, ?> key) Joins the existing table product to a new table using a foreign key.voidaddJoinOnKey(TableLike<?> table, JoinType type, QOM.JoinHint hint) Joins the existing table product to a new table using a foreign key.voidaddJoinOnKey(TableLike<?> table, JoinType type, QOM.JoinHint hint, ForeignKey<?, ?> key) Joins the existing table product to a new table using a foreign key.voidaddJoinOnKey(TableLike<?> table, JoinType type, QOM.JoinHint hint, TableField<?, ?>... keyFields) Joins the existing table product to a new table using a foreign key.voidaddJoinOnKey(TableLike<?> table, JoinType type, TableField<?, ?>... keyFields) Joins the existing table product to a new table using a foreign key.voidaddJoinUsing(TableLike<?> table, Collection<? extends Field<?>> fields) Joins the existing table product to a new table with aUSINGclause.voidaddJoinUsing(TableLike<?> table, JoinType type, Collection<? extends Field<?>> fields) Joins the existing table product to a new table with aUSINGclause.voidaddJoinUsing(TableLike<?> table, JoinType type, QOM.JoinHint hint, Collection<? extends Field<?>> fields) Joins the existing table product to a new table with aUSINGclause.voidLimit the results of this select.voidLimit the results of this select.voidLimit the results of this select.voidLimit the results of this select.voidLimit the results of this select.voidLimit the results of this select.voidAdd a 0-basedOFFSETclause to the query.voidAdd a 0-basedOFFSETclause to the query.voidAdd a SQL Server-style query hint to the select clause.voidaddOrderBy(int... fieldIndexes) Adds ordering fields.voidaddOrderBy(Collection<? extends OrderField<?>> fields) Adds ordering fields.voidaddOrderBy(OrderField<?>... fields) Adds ordering fields.voidaddQualify(Collection<? extends Condition> conditions) Adds new conditions to the qualify clause of the query, connecting them with each other withOperator.AND.voidaddQualify(Condition condition) Adds a new condition to the qualify clause of the query, connecting it with each other withOperator.AND.voidaddQualify(Condition... conditions) Adds new conditions to the qualify clause of the query, connecting them with each other withOperator.AND.voidaddQualify(Operator operator, Collection<? extends Condition> conditions) Adds new conditions to the qualify clause of query, connecting them with each other withoperator.voidaddQualify(Operator operator, Condition condition) Adds a new condition to the qualify clause of query, connecting it with each other withoperator.voidaddQualify(Operator operator, Condition... conditions) Adds new conditions to the qualify clause of query, connecting them with each other withoperator.voidaddSeekAfter(Collection<? extends Field<?>> fields) Adds seeking fields.voidaddSeekAfter(Field<?>... fields) Adds seeking fields.voidaddSeekBefore(Collection<? extends Field<?>> fields) Deprecated.- [#7461] - SEEK BEFORE is not implemented correctlyvoidaddSeekBefore(Field<?>... fields) Deprecated.- [#7461] - SEEK BEFORE is not implemented correctlyvoidaddSelect(Collection<? extends SelectFieldOrAsterisk> fields) Add a list of select fields.voidaddSelect(SelectFieldOrAsterisk... fields) Add a list of select fields.voidaddWindow(Collection<? extends WindowDefinition> definitions) Adds new window definitions to the window clause of the query.voidaddWindow(WindowDefinition... definitions) Adds new window definitions to the window clause of the query.voidsetConnectByStartWith(Condition condition) Add an Oracle-specificSTART WITHclause to the query'sCONNECT BYclause.voidsetDistinct(boolean distinct) Add "distinct" keyword to the select clause.voidsetForJSONAuto(boolean forJSONAuto) Add aFOR JSON AUTOclause to the end of the query.voidsetForJSONB(boolean forJSONB) voidsetForJSONIncludeNullValues(boolean forJSONIncludeNullValues) Add aFOR JSON ROOTclause to the end of the query.voidsetForJSONPath(boolean forJSONPath) Add aFOR JSON PATHclause to the end of the query.voidsetForJSONRoot(boolean forJSONRoot) Add aFOR JSON ROOTclause to the end of the query.voidsetForJSONRoot(boolean forJSONRoot, String rootName) Add aFOR JSON ROOTclause to the end of the query.voidsetForJSONWithoutArrayWrapper(boolean forJSONWithoutArrayWrapper) Add aFOR JSON ROOTclause to the end of the query.voidsetForKeyShare(boolean forKeyShare) Sets the "FOR KEY SHARE" lock mode onto the query.voidSome RDBMS allow for specifying the locking mode for the appliedFOR <lock_mode>clause.voidsetForLockModeOf(Collection<? extends Field<?>> fields) Some RDBMS allow for specifying the fields that should be locked by theFOR <lock_mode>clause, instead of the full row.voidsetForLockModeOf(Field<?>... fields) Some RDBMS allow for specifying the fields that should be locked by theFOR <lock_mode>clause, instead of the full row.voidsetForLockModeOf(Table<?>... tables) Some RDBMS allow for specifying the tables that should be locked by theFOR <lock_mode>clause, instead of the full row.voidSome RDBMS allow for specifying the locking mode for the appliedFOR <lock_mode>clause.voidsetForLockModeWait(int seconds) Some RDBMS allow for specifying the locking mode for the appliedFOR <lock_mode>clause.voidsetForNoKeyUpdate(boolean forNoKeyUpdate) Sets the "FOR NO KEY UPDATE" lock mode onto the query.voidsetForShare(boolean forShare) Sets the "FOR SHARE" lock mode onto the query.voidsetForUpdate(boolean forUpdate) Sets the "FOR UPDATE" lock mode onto the query.voidDeprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeNoWait()voidsetForUpdateOf(Collection<? extends Field<?>> fields) Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeOf(Collection)voidsetForUpdateOf(Field<?>... fields) Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeOf(Field...)voidsetForUpdateOf(Table<?>... tables) Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeOf(Table...)voidDeprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeSkipLocked()voidsetForUpdateWait(int seconds) Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeWait(int)voidsetForXMLAuto(boolean forXMLAuto) Add aFOR XML AUTOclause to the end of the query.voidsetForXMLBinaryBase64(boolean forXMLBinaryBase64) Add aFOR XML BINARY BASE64clause to the end of the query.voidsetForXMLElements(boolean forXMLElements) Add aFOR XML ELEMENTSclause to the end of the query.voidsetForXMLElementsAbsent(boolean forXMLElementsAbsent) Add aFOR XML ELEMENTS ABSENTclause to the end of the query.voidsetForXMLElementsXsinil(boolean forXMLElementsXsinil) Add aFOR XML ELEMENTS XSINILclause to the end of the query.voidsetForXMLExplicit(boolean forXMLExplicit) Add aFOR XML EXPLICITclause to the end of the query.voidsetForXMLPath(boolean forXMLPath) Add aFOR XML PATHclause to the end of the query.voidsetForXMLPath(boolean forXMLPath, String elementName) Add aFOR XML PATHclause to the end of the query.voidsetForXMLRaw(boolean forXMLRaw) Add aFOR XML RAWclause to the end of the query.voidsetForXMLRaw(boolean forXMLRaw, String elementName) Add aFOR XML RAWclause to the end of the query.voidsetForXMLRoot(boolean forXMLRoot) Add aFOR XML ROOTclause to the end of the query.voidsetForXMLRoot(boolean forXMLRoot, String rootName) Add aFOR XML ROOTclause to the end of the query.voidsetForXMLType(boolean forXMLType) Add aFOR XML TYPEclause to the end of the query.voidsetGroupByDistinct(boolean groupByDistinct) Specifies theGROUP BY DISTINCTclause.voidsetInto(Collection<? extends Variable<?>> variables) Add a PL/SQL styleINTOclause to theSELECTstatement to assign the projection of a single rowSELECTstatement to local variables in a procedural context.voidAdd a T-SQL styleINTOclause to theSELECTstatement to create a new table from aSELECTstatement.voidsetLimitPercent(boolean percent) Add thePERCENTclause to aLIMITclause.voidsetOrderBySiblings(boolean orderBySiblings) Indicate whether theSIBLINGSkeyword should be used in anORDER BYclause to form anORDER SIBLINGS BYclause.voidAdd aWITH CHECK OPTIONclause to the end of the subquery.voidAdd aWITH READ ONLYclause to the end of the subquery.voidsetWithTies(boolean withTies) Add theWITH TIESclause to aLIMITclause.Methods inherited from interface org.jooq.Attachable
attach, configuration, detachMethods inherited from interface org.jooq.AttachableQueryPart
getBindValues, getParam, getParams, getSQL, getSQLMethods inherited from interface org.jooq.Fields
dataType, dataType, dataType, dataTypes, field, field, field, field, field, field, field, field, field, field, fields, fields, fields, fields, fields, fieldsIncludingHidden, fieldsRow, fieldStream, indexOf, indexOf, indexOf, type, type, type, typesMethods inherited from interface org.reactivestreams.Publisher
subscribeMethods inherited from interface org.jooq.Query
cancel, execute, executeAsync, executeAsync, isExecutableMethods inherited from interface org.jooq.QueryPart
$replace, $replace, $traverse, $traverse, equals, hashCode, toStringMethods inherited from interface org.jooq.ResultQuery
bind, bind, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, coerce, collect, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAny, fetchAnyArray, fetchAnyInto, fetchAnyInto, fetchAnyMap, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArrays, fetchAsync, fetchAsync, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchInto, fetchInto, fetchInto, fetchLazy, fetchMany, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMaps, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOneArray, fetchOneInto, fetchOneInto, fetchOneMap, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptional, fetchOptionalArray, fetchOptionalInto, fetchOptionalInto, fetchOptionalMap, fetchResultSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSet, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingle, fetchSingleArray, fetchSingleInto, fetchSingleInto, fetchSingleMap, fetchSize, fetchStream, fetchStreamInto, fetchStreamInto, forEach, getRecordType, getResult, iterator, keepStatement, maxRows, poolable, queryTimeout, resultSetConcurrency, resultSetHoldability, resultSetType, spliterator, streamMethods inherited from interface org.jooq.Select
$connectBy, $connectBy, $connectByNoCycle, $connectByNoCycle, $connectByStartWith, $connectByStartWith, $distinct, $distinct, $distinctOn, $distinctOn, $from, $from, $groupBy, $groupBy, $groupByDistinct, $groupByDistinct, $having, $having, $limit, $limit, $limitPercent, $limitPercent, $limitWithTies, $limitWithTies, $offset, $offset, $orderBy, $orderBy, $qualify, $qualify, $select, $select, $where, $where, $window, $window, $with, $with, except, exceptAll, exceptDistinct, getSelect, intersect, intersectAll, intersectDistinct, union, unionAll, unionDistinctMethods inherited from interface org.jooq.TableLike
asMultiset, asMultiset, asMultiset, asMultiset, asTable, asTable, asTable, asTable, asTable, asTable, asTable, asTable, asTable, asTable, asTable, asTable
-
Method Details
-
addSelect
Add a list of select fields.- Parameters:
fields-
-
addSelect
Add a list of select fields.- Parameters:
fields-
-
setDistinct
Add "distinct" keyword to the select clause. -
addDistinctOn
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addDistinctOn(SelectFieldOrAsterisk... fields) Add a PostgreSQL-specificDISTINCT ON (fields…)clause.This also sets the
distinctflag totrue -
addDistinctOn
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addDistinctOn(Collection<? extends SelectFieldOrAsterisk> fields) Add a PostgreSQL-specificDISTINCT ON (fields…)clause.This also sets the
distinctflag totrue -
setInto
@Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,COCKROACHDB,CUBRID,DATABRICKS,DB2,DERBY,DUCKDB,EXASOL,H2,HANA,HSQLDB,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,TERADATA,VERTICA,YUGABYTEDB}) void setInto(Table<?> table) Add a T-SQL styleINTOclause to theSELECTstatement to create a new table from aSELECTstatement. -
setInto
@Pro @Support({AURORA_POSTGRES,DB2,HANA,HSQLDB,INFORMIX,MARIADB,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLSERVER,YUGABYTEDB}) void setInto(Collection<? extends Variable<?>> variables) Add a PL/SQL styleINTOclause to theSELECTstatement to assign the projection of a single rowSELECTstatement to local variables in a procedural context. -
addFrom
Add tables to the table product.- Parameters:
from- The added tables
-
addFrom
Add tables to the table product.- Parameters:
from- The added tables
-
addFrom
Add tables to the table product.- Parameters:
from- The added tables
-
addJoin
Joins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.- Parameters:
table- The joined tablecondition- The joining condition
-
addJoin
Joins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.- Parameters:
table- The joined tableconditions- The joining conditions
-
addJoin
Joins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.- Parameters:
table- The joined tabletype- The type of joincondition- The joining condition
-
addJoin
Joins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.- Parameters:
table- The joined tabletype- The type of joinconditions- The joining conditions
-
addJoin
Joins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.QOM.JoinHintare a commercial only feature and are ignored in the jOOQ Open Source Edition.- Parameters:
table- The joined tabletype- The type of joinhint- The hint to apply to the joincondition- The joining condition
-
addJoin
@Support void addJoin(TableLike<?> table, JoinType type, QOM.JoinHint hint, Condition... conditions) Joins the existing table product to a new table using a condition, connecting them with each other withOperator.AND.QOM.JoinHintare a commercial only feature and are ignored in the jOOQ Open Source Edition.- Parameters:
table- The joined tabletype- The type of joinhint- The hint to apply to the joinconditions- The joining conditions
-
addJoin
@Support(ORACLE) @Pro void addJoin(TableLike<?> table, JoinType type, Condition conditions, Field<?>[] partitionBy) Joins the existing table product to a new table using conditions, connecting them with each other withOperator.AND.This adds a
PARTITION BYclause to the right hand side of aOUTER JOINexpression.- Parameters:
table- The joined tabletype- The type of joinconditions- The joining conditionspartitionBy- ThePARTITION BYexpression- See Also:
-
addJoin
@Support(ORACLE) @Pro void addJoin(TableLike<?> table, JoinType type, Condition[] conditions, Field<?>[] partitionBy) Joins the existing table product to a new table using conditions, connecting them with each other withOperator.AND.This adds a
PARTITION BYclause to the right hand side of aOUTER JOINexpression.- Parameters:
table- The joined tabletype- The type of joinconditions- The joining conditionspartitionBy- ThePARTITION BYexpression- See Also:
-
addJoin
@Support(ORACLE) @Pro void addJoin(TableLike<?> table, JoinType type, QOM.JoinHint hint, Condition conditions, Field<?>[] partitionBy) Joins the existing table product to a new table using conditions, connecting them with each other withOperator.AND.This adds a
PARTITION BYclause to the right hand side of aOUTER JOINexpression.QOM.JoinHintare a commercial only feature and are ignored in the jOOQ Open Source Edition.- Parameters:
table- The joined tabletype- The type of joinhint- The hint to apply to the joinconditions- The joining conditionspartitionBy- ThePARTITION BYexpression- See Also:
-
addJoin
@Support(ORACLE) @Pro void addJoin(TableLike<?> table, JoinType type, QOM.JoinHint hint, Condition[] conditions, Field<?>[] partitionBy) Joins the existing table product to a new table using conditions, connecting them with each other withOperator.AND.This adds a
PARTITION BYclause to the right hand side of aOUTER JOINexpression.QOM.JoinHintare a commercial only feature and are ignored in the jOOQ Open Source Edition.- Parameters:
table- The joined tabletype- The type of joinhint- The hint to apply to the joinconditions- The joining conditionspartitionBy- ThePARTITION BYexpression- See Also:
-
addJoinUsing
Joins the existing table product to a new table with aUSINGclause.If this is not supported by your RDBMS, then jOOQ will try to emulate this behaviour using the information provided in this query.
- Parameters:
table- The joined tablefields- The fields for theUSINGclause
-
addJoinUsing
@Support void addJoinUsing(TableLike<?> table, JoinType type, Collection<? extends Field<?>> fields) Joins the existing table product to a new table with aUSINGclause.If this is not supported by your RDBMS, then jOOQ will try to emulate this behaviour using the information provided in this query.
- Parameters:
table- The joined tabletype- The type of joinfields- The fields for theUSINGclause
-
addJoinUsing
@Support void addJoinUsing(TableLike<?> table, JoinType type, QOM.JoinHint hint, Collection<? extends Field<?>> fields) Joins the existing table product to a new table with aUSINGclause.If this is not supported by your RDBMS, then jOOQ will try to emulate this behaviour using the information provided in this query.
QOM.JoinHintare a commercial only feature and are ignored in the jOOQ Open Source Edition.- Parameters:
table- The joined tabletype- The type of joinhint- The hint to apply to the joinfields- The fields for theUSINGclause
-
addJoinOnKey
Joins the existing table product to a new table using a foreign key.- Parameters:
table- The joined tabletype- The type of join- Throws:
DataAccessException- If there is no non-ambiguous key definition known to jOOQ. Please note that if you evolve your schema, a previously non-ambiguousON KEYclause can suddenly become ambiguous on an existing query, so use this clause with care.- See Also:
-
addJoinOnKey
@Support void addJoinOnKey(TableLike<?> table, JoinType type, TableField<?, ?>... keyFields) throws DataAccessExceptionJoins the existing table product to a new table using a foreign key.- Parameters:
table- The joined tabletype- The type of joinkeyFields- The foreign key fields- Throws:
DataAccessException- If there is no non-ambiguous key definition known to jOOQ. Please note that if you evolve your schema, a previously non-ambiguousON KEYclause can suddenly become ambiguous on an existing query, so use this clause with care.- See Also:
-
addJoinOnKey
@Support void addJoinOnKey(TableLike<?> table, JoinType type, QOM.JoinHint hint) throws DataAccessException Joins the existing table product to a new table using a foreign key.QOM.JoinHintare a commercial only feature and are ignored in the jOOQ Open Source Edition.- Parameters:
table- The joined tabletype- The type of joinhint- The hint to apply to the join- Throws:
DataAccessException- If there is no non-ambiguous key definition known to jOOQ. Please note that if you evolve your schema, a previously non-ambiguousON KEYclause can suddenly become ambiguous on an existing query, so use this clause with care.- See Also:
-
addJoinOnKey
@Support void addJoinOnKey(TableLike<?> table, JoinType type, QOM.JoinHint hint, TableField<?, ?>... keyFields) throws DataAccessExceptionJoins the existing table product to a new table using a foreign key.QOM.JoinHintare a commercial only feature and are ignored in the jOOQ Open Source Edition.- Parameters:
table- The joined tabletype- The type of joinhint- The hint to apply to the joinkeyFields- The foreign key fields- Throws:
DataAccessException- If there is no non-ambiguous key definition known to jOOQ. Please note that if you evolve your schema, a previously non-ambiguousON KEYclause can suddenly become ambiguous on an existing query, so use this clause with care.- See Also:
-
addJoinOnKey
Joins the existing table product to a new table using a foreign key.- Parameters:
table- The joined tabletype- The type of joinkey- The foreign key- See Also:
-
addJoinOnKey
@Support void addJoinOnKey(TableLike<?> table, JoinType type, QOM.JoinHint hint, ForeignKey<?, ?> key) Joins the existing table product to a new table using a foreign key.QOM.JoinHintare a commercial only feature and are ignored in the jOOQ Open Source Edition.- Parameters:
table- The joined tabletype- The type of joinhint- The hint to apply to the joinkey- The foreign key- See Also:
-
addGroupBy
Adds grouping fields.Calling this with an empty argument list will result in an empty
GROUP BY ()clause being rendered.- Parameters:
fields- The grouping fields
-
addGroupBy
Adds grouping fields.Calling this with an empty argument list will result in an empty
GROUP BY ()clause being rendered.- Parameters:
fields- The grouping fields
-
setGroupByDistinct
Specifies theGROUP BY DISTINCTclause.This is mostly useful when combined with
DSL.groupingSets(Field[]...)to remove duplicate grouping set results prior to aggregation and projection. -
addHaving
Adds a new condition to the having clause of the query, connecting it with each other withOperator.AND.- Parameters:
condition- The condition
-
addHaving
Adds new conditions to the having clause of the query, connecting them with each other withOperator.AND.- Parameters:
conditions- The condition
-
addHaving
Adds new conditions to the having clause of the query, connecting them with each other withOperator.AND.- Parameters:
conditions- The condition
-
addHaving
Adds a new condition to the having clause of query, connecting it with each other withoperator.- Parameters:
operator- The operator to use to add the conditions to the existing conditionscondition- The condition
-
addHaving
Adds new conditions to the having clause of query, connecting them with each other withoperator.- Parameters:
operator- The operator to use to add the conditions to the existing conditionsconditions- The condition
-
addHaving
Adds new conditions to the having clause of query, connecting them with each other withoperator.- Parameters:
operator- The operator to use to add the conditions to the existing conditionsconditions- The condition
-
addWindow
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addWindow(WindowDefinition... definitions) Adds new window definitions to the window clause of the query.- Parameters:
definitions- The definitions
-
addWindow
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addWindow(Collection<? extends WindowDefinition> definitions) Adds new window definitions to the window clause of the query.- Parameters:
definitions- The definitions
-
addQualify
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addQualify(Condition condition) Adds a new condition to the qualify clause of the query, connecting it with each other withOperator.AND.- Parameters:
condition- The condition
-
addQualify
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addQualify(Condition... conditions) Adds new conditions to the qualify clause of the query, connecting them with each other withOperator.AND.- Parameters:
conditions- The condition
-
addQualify
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addQualify(Collection<? extends Condition> conditions) Adds new conditions to the qualify clause of the query, connecting them with each other withOperator.AND.- Parameters:
conditions- The condition
-
addQualify
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addQualify(Operator operator, Condition condition) Adds a new condition to the qualify clause of query, connecting it with each other withoperator.- Parameters:
operator- The operator to use to add the conditions to the existing conditionscondition- The condition
-
addQualify
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addQualify(Operator operator, Condition... conditions) Adds new conditions to the qualify clause of query, connecting them with each other withoperator.- Parameters:
operator- The operator to use to add the conditions to the existing conditionsconditions- The condition
-
addQualify
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addQualify(Operator operator, Collection<? extends Condition> conditions) Adds new conditions to the qualify clause of query, connecting them with each other withoperator.- Parameters:
operator- The operator to use to add the conditions to the existing conditionsconditions- The condition
-
addHint
Add an Oracle-style hint to the select clause.Example:
DSLContext create = DSL.using(configuration); create.select(field1, field2) .hint("/*+ALL_ROWS*/") .from(table1) .execute();You can also use this clause for any other database, that accepts hints or options at the same syntactic location, e.g. for MySQL's
SQL_CALC_FOUND_ROWSoption:create.select(field1, field2) .hint("SQL_CALC_FOUND_ROWS") .from(table1) .fetch();The outcome of such a query is this:
SELECT [hint] field1, field2 FROM table1For SQL Server style table hints, see
Table.with(String)- See Also:
-
addOption
Add a SQL Server-style query hint to the select clause.Example:
DSLContext create = DSL.using(configuration); create.select(field1, field2) .from(table1) .option("OPTION (OPTIMIZE FOR UNKNOWN)") .execute();You can also use this clause for any other database, that accepts hints or options at the same syntactic location, e.g. for DB2's isolation clause:
create.select(field1, field2) .from(table1) .option("WITH RR USE AND KEEP EXCLUSIVE LOCKS") .execute();The outcome of such a query is this:
SELECT field1, field2 FROM table1 [option]For SQL Server style table hints, see
Table.with(String)- See Also:
-
addConnectBy
@Support({AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,EXASOL,FIREBIRD,H2,HSQLDB,INFORMIX,MARIADB,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,YUGABYTEDB}) @Pro void addConnectBy(Condition condition) Add an Oracle-specificCONNECT BYclause to the query.Simple versions of this clause can be emulated using
DSL.generateSeries(int, int). -
addConnectByNoCycle
Add an Oracle-specificCONNECT BY NOCYCLEclause to the query. -
setConnectByStartWith
@Support({CUBRID,EXASOL,INFORMIX,ORACLE,SNOWFLAKE}) @Pro void setConnectByStartWith(Condition condition) Add an Oracle-specificSTART WITHclause to the query'sCONNECT BYclause. -
addConditions
Description copied from interface:ConditionProviderAdds a new condition to the query, connecting them to existing conditions withOperator.AND.- Specified by:
addConditionsin interfaceConditionProvider- Parameters:
condition- The condition
-
addConditions
Description copied from interface:ConditionProviderAdds new conditions to the query, connecting them to existing conditions withOperator.AND.- Specified by:
addConditionsin interfaceConditionProvider- Parameters:
conditions- The condition
-
addConditions
Description copied from interface:ConditionProviderAdds new conditions to the query, connecting them to existing conditions withOperator.AND.- Specified by:
addConditionsin interfaceConditionProvider- Parameters:
conditions- The condition
-
addConditions
Description copied from interface:ConditionProviderAdds a new condition to the query, connecting them to existing conditions with the provided operator.- Specified by:
addConditionsin interfaceConditionProvider- Parameters:
condition- The condition
-
addConditions
Description copied from interface:ConditionProviderAdds new conditions to the query, connecting them to existing conditions with the provided operator.- Specified by:
addConditionsin interfaceConditionProvider- Parameters:
conditions- The condition
-
addConditions
Description copied from interface:ConditionProviderAdds new conditions to the query, connecting them to existing conditions with the provided operator.- Specified by:
addConditionsin interfaceConditionProvider- Parameters:
conditions- The condition
-
addOrderBy
Adds ordering fields.- Parameters:
fields- The ordering fields
-
addOrderBy
Adds ordering fields.- Parameters:
fields- The ordering fields
-
addOrderBy
Adds ordering fields.Indexes start at
1in SQL!Note, you can use
addOrderBy(DSL.val(1).desc())oraddOrderBy(DSL.literal(1).desc())to apply descending ordering- Parameters:
fieldIndexes- The ordering fields
-
setOrderBySiblings
Indicate whether theSIBLINGSkeyword should be used in anORDER BYclause to form anORDER SIBLINGS BYclause.This clause can be used only along with Oracle's
CONNECT BYclause, to indicate that the hierarchical ordering should be preserved and elements of each hierarchy should be ordered among themselves.- Parameters:
orderBySiblings-
-
addSeekAfter
Adds seeking fields.- Parameters:
fields- The seeking fields
-
addSeekAfter
Adds seeking fields.- Parameters:
fields- The seeking fields
-
addSeekBefore
Deprecated.- [#7461] - SEEK BEFORE is not implemented correctlyAdds seeking fields.- Parameters:
fields- The seeking fields
-
addSeekBefore
Deprecated.- [#7461] - SEEK BEFORE is not implemented correctlyAdds seeking fields.- Parameters:
fields- The seeking fields
-
addOffset
@Support({AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DERBY,DUCKDB,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addOffset(Number offset) Add a 0-basedOFFSETclause to the query.Offsets are 0-based as they describe the number of rows to skip.
If there is no
LIMIT … OFFSETorTOPclause in your RDBMS, or if your RDBMS does not natively support offsets, this is emulated with aROW_NUMBER()window function and nestedSELECTstatements. -
addOffset
@Support({AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DERBY,DUCKDB,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addOffset(Field<? extends Number> offset) Add a 0-basedOFFSETclause to the query.Offsets are 0-based as they describe the number of rows to skip.
If there is no
LIMIT … OFFSETorTOPclause in your RDBMS, or if your RDBMS does not natively support offsets, this is emulated with aROW_NUMBER()window function and nestedSELECTstatements. -
addLimit
Limit the results of this select.This is the same as calling
addLimit(Number, Number)with offset = 0- Parameters:
numberOfRows- The number of rows to return
-
addLimit
@Support({AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DERBY,DUCKDB,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addLimit(Field<? extends Number> numberOfRows) Limit the results of this select.Note that some dialects do not support bind values at all in
LIMITorTOPclauses!If there is no
LIMITorTOPclause in your RDBMS, or theLIMITorTOPclause does not support bind values, this may be emulated with aROW_NUMBER()window function and nestedSELECTstatements.This is the same as calling
addLimit(Number, Number)with offset = 0- Parameters:
numberOfRows- The number of rows to return
-
addLimit
@Support({AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DERBY,DUCKDB,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addLimit(Number offset, Number numberOfRows) Limit the results of this select.Note that some dialects do not support bind values at all in
LIMITorTOPclauses!If there is no
LIMITorTOPclause in your RDBMS, or if your RDBMS does not natively support offsets, this is emulated with aROW_NUMBER()window function and nestedSELECTstatements.- Parameters:
offset- The lowest offset starting at 0numberOfRows- The number of rows to return
-
addLimit
@Support({AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DERBY,DUCKDB,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addLimit(Field<? extends Number> offset, Number numberOfRows) Limit the results of this select.Note that some dialects do not support bind values at all in
LIMITorTOPclauses!If there is no
LIMITorTOPclause in your RDBMS, or theLIMITorTOPclause does not support bind values, or if your RDBMS does not natively support offsets, this may be emulated with aROW_NUMBER()window function and nestedSELECTstatements.- Parameters:
offset- The lowest offset starting at 0numberOfRows- The number of rows to return
-
addLimit
@Support({AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DERBY,DUCKDB,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addLimit(Number offset, Field<? extends Number> numberOfRows) Limit the results of this select.Note that some dialects do not support bind values at all in
LIMITorTOPclauses!If there is no
LIMITorTOPclause in your RDBMS, or theLIMITorTOPclause does not support bind values, or if your RDBMS does not natively support offsets, this may be emulated with aROW_NUMBER()window function and nestedSELECTstatements.- Parameters:
offset- The lowest offset starting at 0numberOfRows- The number of rows to return
-
addLimit
@Support({AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DERBY,DUCKDB,EXASOL,FIREBIRD,H2,HANA,HSQLDB,IGNITE,INFORMIX,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void addLimit(Field<? extends Number> offset, Field<? extends Number> numberOfRows) Limit the results of this select.Note that some dialects do not support bind values at all in
LIMITorTOPclauses!If there is no
LIMITorTOPclause in your RDBMS, or theLIMITorTOPclause does not support bind values, or if your RDBMS does not natively support offsets, this may be emulated with aROW_NUMBER()window function and nestedSELECTstatements.- Parameters:
offset- The lowest offset starting at 0numberOfRows- The number of rows to return
-
setLimitPercent
Add thePERCENTclause to aLIMITclause. -
setWithTies
@Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,CUBRID,DATABRICKS,DB2,DUCKDB,EXASOL,FIREBIRD_3_0,H2,HANA,INFORMIX,MARIADB,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLSERVER,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) void setWithTies(boolean withTies) Add theWITH TIESclause to aLIMITclause. -
setForUpdate
@Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLSERVER,SYBASE,TERADATA,YUGABYTEDB}) void setForUpdate(boolean forUpdate) Sets the "FOR UPDATE" lock mode onto the query.Native implementation
This has been observed to be supported by any of these dialects:
- DB2 FOR UPDATE and similar clauses
- Derby's FOR UPDATE clause
- H2's FOR UPDATE clause
- HSQLDB's FOR UPDATE clause
- MySQL's InnoDB locking reads
- Oracle's PL/SQL FOR UPDATE clause
- Postgres FOR UPDATE / FOR SHARE
Emulation
SQLDialect.SQLSERVER: jOOQ will try to lock the database record usingWITH (ROWLOCK, UPDLOCK)hints.Not supported
These dialects are known not to support the
FOR UPDATEclause in regular SQL:- Parameters:
forUpdate- The flag's value
-
setForNoKeyUpdate
@Support({AURORA_POSTGRES,COCKROACHDB,POSTGRES,YUGABYTEDB}) void setForNoKeyUpdate(boolean forNoKeyUpdate) Sets the "FOR NO KEY UPDATE" lock mode onto the query. -
setForUpdateOf
@Deprecated(forRemoval=true, since="3.14") @Support({COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,ORACLE,SYBASE}) void setForUpdateOf(Field<?>... fields) Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeOf(Field...)Some RDBMS allow for specifying the fields that should be locked by theFOR UPDATEclause, instead of the full row.This automatically sets the
setForUpdate(boolean)flag, and unsets thesetForShare(boolean)flag, if it was previously set.This has been observed to be natively supported by any of these dialects:
- DB2
- Derby
- H2
- HSQLDB
- Ingres
- Oracle
- Sybase
Note, that
SQLDialect.DB2has some stricter requirements regarding the updatability of fields. Refer to the DB2 documentation for further details- Parameters:
fields- The fields that should be locked
-
setForUpdateOf
@Deprecated(forRemoval=true, since="3.14") @Support({COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,ORACLE,SYBASE}) void setForUpdateOf(Collection<? extends Field<?>> fields) Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeOf(Collection)Some RDBMS allow for specifying the fields that should be locked by theFOR UPDATEclause, instead of the full row.- See Also:
-
setForUpdateOf
@Deprecated(forRemoval=true, since="3.14") @Support({AURORA_POSTGRES,COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,MYSQL_8_0,ORACLE,POSTGRES,SQLSERVER,SYBASE,YUGABYTEDB}) void setForUpdateOf(Table<?>... tables) Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeOf(Table...)Some RDBMS allow for specifying the tables that should be locked by theFOR UPDATEclause, instead of the full row.This automatically sets the
setForUpdate(boolean)flag, and unsets thesetForShare(boolean)flag, if it was previously set.This has been observed to be natively supported by any of these dialects:
- Postgres
- H2
- HSQLDB
- Sybase
jOOQ emulates this by locking all known fields of [
tables] for any of these dialects:- DB2
- Derby
- Ingres
- Oracle
- Parameters:
tables- The tables that should be locked
-
setForUpdateWait
@Deprecated(forRemoval=true, since="3.14") @Support({MARIADB_10_3,ORACLE}) void setForUpdateWait(int seconds) Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeWait(int)Some RDBMS allow for specifying the locking mode for the appliedFOR UPDATEclause. In this case, the session will wait for someseconds, before aborting the lock acquirement if the lock is not available.This automatically sets the
setForUpdate(boolean)flag, and unsets thesetForShare(boolean)flag, if it was previously set.This has been observed to be supported by any of these dialects:
- Oracle
- Parameters:
seconds- The number of seconds to wait for a lock
-
setForUpdateNoWait
@Deprecated(forRemoval=true, since="3.14") @Support({AURORA_POSTGRES,MARIADB_10_3,MYSQL_8_0,ORACLE,POSTGRES,SQLSERVER,YUGABYTEDB}) void setForUpdateNoWait()Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeNoWait()Some RDBMS allow for specifying the locking mode for the appliedFOR UPDATEclause. In this case, the session will not wait before aborting the lock acquirement if the lock is not available.This automatically sets the
setForUpdate(boolean)flag, and unsets thesetForShare(boolean)flag, if it was previously set.This has been observed to be supported by any of these dialects:
- Oracle
-
setForUpdateSkipLocked
@Deprecated(forRemoval=true, since="3.14") @Support({AURORA_POSTGRES,MYSQL_8_0,ORACLE,POSTGRES_9_5,SQLSERVER,YUGABYTEDB}) void setForUpdateSkipLocked()Deprecated, for removal: This API element is subject to removal in a future version.[#5218] - 3.14.0 - UsesetForLockModeSkipLocked()Some RDBMS allow for specifying the locking mode for the appliedFOR UPDATEclause. In this case, the session will skip all locked rows from the select statement, whose lock is not available.This automatically sets the
setForUpdate(boolean)flag, and unsets thesetForShare(boolean)flag, if it was previously set.This has been observed to be supported by any of these dialects:
- Oracle
-
setForLockModeOf
@Support({DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,ORACLE,SYBASE}) void setForLockModeOf(Field<?>... fields) Some RDBMS allow for specifying the fields that should be locked by theFOR <lock_mode>clause, instead of the full row.In case no lock mode has been set yet, it will implicitly be set to
UPDATE(i.e.setForUpdate(boolean)).Depending on the dialect and lock mode this flag may or may not be supported.
Note, that
SQLDialect.DB2has some stricter requirements regarding the updatability of fields. Refer to the DB2 documentation for further details- Parameters:
fields- The fields that should be locked
-
setForLockModeOf
@Support({DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,ORACLE,SYBASE}) void setForLockModeOf(Collection<? extends Field<?>> fields) Some RDBMS allow for specifying the fields that should be locked by theFOR <lock_mode>clause, instead of the full row.- See Also:
-
setForLockModeOf
@Support({AURORA_POSTGRES,COCKROACHDB,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,MYSQL_8_0,ORACLE,POSTGRES,SQLSERVER,SYBASE,YUGABYTEDB}) void setForLockModeOf(Table<?>... tables) Some RDBMS allow for specifying the tables that should be locked by theFOR <lock_mode>clause, instead of the full row.In case no lock mode has been set yet, it will implicitly be set to
UPDATE(i.e.setForUpdate(boolean)).Depending on the dialect and lock mode this flag may or may not be supported.
- Parameters:
tables- The tables that should be locked
-
setForLockModeWait
@Support({AURORA_MYSQL,AURORA_POSTGRES,H2,MARIADB,MYSQL,ORACLE,POSTGRES}) void setForLockModeWait(int seconds) Some RDBMS allow for specifying the locking mode for the appliedFOR <lock_mode>clause. In this case, the session will wait for someseconds, before aborting the lock acquirement if the lock is not available.In case no lock mode has been set yet, it will implicitly be set to
UPDATE(i.e.setForUpdate(boolean)).Depending on the dialect and lock mode this flag may or may not be supported.
- Parameters:
seconds- The number of seconds to wait for a lock
-
setForLockModeNoWait
@Support({AURORA_POSTGRES,H2,MARIADB_10_3,MYSQL_8_0,ORACLE,POSTGRES,SQLSERVER,YUGABYTEDB}) void setForLockModeNoWait()Some RDBMS allow for specifying the locking mode for the appliedFOR <lock_mode>clause. In this case, the session will not wait before aborting the lock acquirement if the lock is not available.In case no lock mode has been set yet, it will implicitly be set to
UPDATE(i.e.setForUpdate(boolean)).Depending on the dialect and lock mode this flag may or may not be supported.
-
setForLockModeSkipLocked
@Support({AURORA_POSTGRES,H2,MARIADB_10_6,MYSQL_8_0,ORACLE,POSTGRES_9_5,SQLSERVER,YUGABYTEDB}) void setForLockModeSkipLocked()Some RDBMS allow for specifying the locking mode for the appliedFOR <lock_mode>clause. In this case, the session will skip all locked rows from the select statement, whose lock is not available.In case no lock mode has been set yet, it will implicitly be set to
UPDATE(i.e.setForUpdate(boolean)).Depending on the dialect and lock mode this flag may or may not be supported.
-
setForXMLRaw
Add aFOR XML RAWclause to the end of the query. -
setForXMLRaw
@Support({DB2,ORACLE,POSTGRES,SQLSERVER,TERADATA}) @Pro void setForXMLRaw(boolean forXMLRaw, String elementName) Add aFOR XML RAWclause to the end of the query. -
setForXMLAuto
@Support({DB2,ORACLE,POSTGRES,SQLSERVER,SYBASE,TERADATA}) @Pro void setForXMLAuto(boolean forXMLAuto) Add aFOR XML AUTOclause to the end of the query. -
setForXMLPath
Add aFOR XML PATHclause to the end of the query. -
setForXMLPath
@Support({DB2,ORACLE,POSTGRES,SQLSERVER,TERADATA}) @Pro void setForXMLPath(boolean forXMLPath, String elementName) Add aFOR XML PATHclause to the end of the query. -
setForXMLExplicit
Add aFOR XML EXPLICITclause to the end of the query. -
setForXMLBinaryBase64
Add aFOR XML BINARY BASE64clause to the end of the query. -
setForXMLType
Add aFOR XML TYPEclause to the end of the query. -
setForXMLRoot
Add aFOR XML ROOTclause to the end of the query. -
setForXMLRoot
@Support({DB2,ORACLE,POSTGRES,SQLSERVER,TERADATA}) @Pro void setForXMLRoot(boolean forXMLRoot, String rootName) Add aFOR XML ROOTclause to the end of the query. -
setForXMLElements
@Support({DB2,ORACLE,POSTGRES,SQLSERVER,SYBASE,TERADATA}) @Pro void setForXMLElements(boolean forXMLElements) Add aFOR XML ELEMENTSclause to the end of the query. -
setForXMLElementsXsinil
Add aFOR XML ELEMENTS XSINILclause to the end of the query. -
setForXMLElementsAbsent
Add aFOR XML ELEMENTS ABSENTclause to the end of the query. -
setForJSONB
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DB2_11,H2,MARIADB_10_5,MYSQL_5_7,ORACLE12C,POSTGRES,SQLSERVER,SYBASE,TRINO,YUGABYTEDB}) @Pro void setForJSONB(boolean forJSONB) -
setForJSONAuto
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DB2_11,H2,MARIADB_10_5,MYSQL_5_7,ORACLE12C,POSTGRES,SQLSERVER,SYBASE,TRINO,YUGABYTEDB}) @Pro void setForJSONAuto(boolean forJSONAuto) Add aFOR JSON AUTOclause to the end of the query. -
setForJSONPath
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DB2_11,H2,MARIADB_10_5,MYSQL_5_7,ORACLE12C,POSTGRES,SQLSERVER,TRINO,YUGABYTEDB}) @Pro void setForJSONPath(boolean forJSONPath) Add aFOR JSON PATHclause to the end of the query. -
setForJSONRoot
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DB2_11,H2,MARIADB_10_5,MYSQL_5_7,ORACLE12C,POSTGRES,SQLSERVER,TRINO,YUGABYTEDB}) @Pro void setForJSONRoot(boolean forJSONRoot) Add aFOR JSON ROOTclause to the end of the query. -
setForJSONRoot
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DB2_11,H2,MARIADB_10_5,MYSQL_5_7,ORACLE12C,POSTGRES,SQLSERVER,TRINO,YUGABYTEDB}) @Pro void setForJSONRoot(boolean forJSONRoot, String rootName) Add aFOR JSON ROOTclause to the end of the query. -
setForJSONIncludeNullValues
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DB2_11,H2,MARIADB_10_5,MYSQL_5_7,ORACLE12C,POSTGRES,SQLSERVER,TRINO,YUGABYTEDB}) @Pro void setForJSONIncludeNullValues(boolean forJSONIncludeNullValues) Add aFOR JSON ROOTclause to the end of the query. -
setForJSONWithoutArrayWrapper
@Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DB2_11,H2,MARIADB_10_5,MYSQL_5_7,ORACLE12C,POSTGRES,SQLSERVER,TRINO,YUGABYTEDB}) @Pro void setForJSONWithoutArrayWrapper(boolean forJSONWithoutArrayWrapper) Add aFOR JSON ROOTclause to the end of the query. -
setWithCheckOption
@Support({ASE,DB2,FIREBIRD,HANA,INFORMIX,MARIADB,MYSQL,ORACLE,POSTGRES,SQLSERVER,SYBASE,TERADATA}) void setWithCheckOption()Add aWITH CHECK OPTIONclause to the end of the subquery. -
setWithReadOnly
@Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,BIGQUERY,COCKROACHDB,CUBRID,DB2,DERBY,EXASOL,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA,VERTICA,YUGABYTEDB}) void setWithReadOnly()Add aWITH READ ONLYclause to the end of the subquery.
-