public interface UpdateResultStep<R extends Record> extends Update<R>
Update
's DSL API.
Example:
DSLContext create = DSL.using(configuration);
TableRecord<?> record =
create.update(table)
.set(field1, value1)
.set(field2, value2)
.returning(field1)
.fetchOne();
This implemented differently for every dialect:
UPDATE .. RETURNING
clausesSELECT .. FROM FINAL TABLE (UPDATE ...)
XYZ*Step
types directly from client code
It is usually not recommended to reference any XYZ*Step
types
directly from client code, or assign them to local variables. When writing
dynamic SQL, creating a statement's components dynamically, and passing them
to the DSL API statically is usually a better choice. See the manual's
section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
Drawbacks of referencing the XYZ*Step
types directly:
Modifier and Type | Method and Description |
---|---|
Result<R> |
fetch()
The result holding returned values as specified by the
UpdateReturningStep . |
R |
fetchOne()
The record holding returned values as specified by the
UpdateReturningStep . |
Optional<R> |
fetchOptional()
The record holding returned values as specified by the
UpdateReturningStep . |
bind, bind, cancel, close, execute, executeAsync, executeAsync, getBindValues, getParam, getParams, getSQL, getSQL, getSQL, isExecutable, keepStatement, queryTimeout
attach, configuration, detach
@Support(value={AURORA_POSTGRES,DB2,FIREBIRD,ORACLE,POSTGRES}) Result<R> fetch() throws DataAccessException
UpdateReturningStep
.UpdateReturningStep
. Note:
Result
in case jOOQ could not retrieve any generated
keys from the JDBC driver.DataAccessException
- if something went wrong executing the queryUpdateQuery.getReturnedRecords()
@Support(value={AURORA_POSTGRES,DB2,FIREBIRD,ORACLE,POSTGRES}) R fetchOne() throws DataAccessException, TooManyRowsException
UpdateReturningStep
.UpdateReturningStep
. This may return null
in
case jOOQ could not retrieve any generated keys from the JDBC
driver.DataAccessException
- if something went wrong executing the queryTooManyRowsException
- if the query returned more than one recordUpdateQuery.getReturnedRecord()
@Support(value={AURORA_POSTGRES,DB2,FIREBIRD,ORACLE,POSTGRES}) Optional<R> fetchOptional() throws DataAccessException, TooManyRowsException
UpdateReturningStep
.UpdateReturningStep
.DataAccessException
- if something went wrong executing the queryTooManyRowsException
- if the query returned more than one recordUpdateQuery.getReturnedRecord()
Copyright © 2019. All rights reserved.