org.h2.command.query

## Class ForUpdate

- java.lang.Object
- - org.h2.command.query.ForUpdate

All Implemented Interfaces:
  HasSQL

    public final class ForUpdate
    extends java.lang.Object
    implements HasSQL

FOR UPDATE clause.

### Nested Class Summary

Nested Classes
`static class` `ForUpdate.Type` Type of FOR UPDATE clause.

### Field Summary

Fields
`static ForUpdate` `DEFAULT` FOR UPDATE clause without additional parameters.
`static ForUpdate` `NOWAIT` FOR UPDATE NOWAIT clause.
`static ForUpdate` `SKIP_LOCKED` FOR UPDATE SKIP LOCKED clause.

### Fields inherited from interface org.h2.util.HasSQL

`ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`java.lang.StringBuilder` `getSQL(java.lang.StringBuilder builder, int sqlFlags)` Appends the SQL statement of this object to the specified builder.
`int` `getTimeoutMillis()` Returns timeout in milliseconds.
`ForUpdate.Type` `getType()` Returns type of FOR UPDATE clause.
`static ForUpdate` `wait(int timeoutMillis)` Returns FOR UPDATE WAIT N clause.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.h2.util.HasSQL

`getSQL, getTraceSQL`

### Field Detail

#### DEFAULT

    public static final ForUpdate DEFAULT

FOR UPDATE clause without additional parameters.

#### NOWAIT

    public static final ForUpdate NOWAIT

FOR UPDATE NOWAIT clause.

#### SKIP_LOCKED

    public static final ForUpdate SKIP_LOCKED

FOR UPDATE SKIP LOCKED clause.

### Method Detail

#### wait

    public static final ForUpdate wait(int timeoutMillis)

Returns FOR UPDATE WAIT N clause.

Parameters:
  `timeoutMillis` - timeout in milliseconds
Returns:
  FOR UPDATE WAIT N clause

#### getType

    public ForUpdate.Type getType()

Returns type of FOR UPDATE clause.

Returns:
  type of FOR UPDATE clause

#### getTimeoutMillis

    public int getTimeoutMillis()

Returns timeout in milliseconds.

Returns:
  timeout in milliseconds for `ForUpdate.Type.WAIT`, `0` for `ForUpdate.Type.NOWAIT`, `-2` for `ForUpdate.Type.SKIP_LOCKED`, `-1` for default timeout

#### getSQL

    public java.lang.StringBuilder getSQL(java.lang.StringBuilder builder,
                                          int sqlFlags)

Description copied from interface: `HasSQL`
Appends the SQL statement of this object to the specified builder.

Specified by:
  `getSQL` in interface `HasSQL`
Parameters:
  `builder` - string builder
  `sqlFlags` - formatting flags
Returns:
  the specified string builder