Package org.h2.command.query

# Class ForUpdate

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

All Implemented Interfaces:
  `HasSQL`

public final class ForUpdate extends Object implements HasSQL
FOR UPDATE clause.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`ForUpdate.Type`
Type of FOR UPDATE clause.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final ForUpdate`
`DEFAULT`
FOR UPDATE clause without additional parameters.
`static final ForUpdate`
`NOWAIT`
FOR UPDATE NOWAIT clause.
`static final 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

Modifier and Type
Method
Description
`StringBuilder`
`getSQL(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 Details

### 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 Details

### wait

public static 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 StringBuilder getSQL(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