org.h2.engine

## Class GeneratedKeys

- java.lang.Object
- - org.h2.engine.GeneratedKeys

    public final class GeneratedKeys
    extends java.lang.Object

Class for gathering and processing of generated keys.

### Constructor Summary

Constructors
Constructor and Description
`GeneratedKeys()`

### Method Summary

Methods
`void` `add(Column column)` Remembers columns with generated keys.
`void` `clear(java.lang.Object generatedKeysRequest)` Clears all information from previous runs and sets a new request for gathering of generated keys.
`void` `confirmRow(Row tableRow)` Saves row with generated keys if any.
`LocalResult` `getKeys(Session session)` Returns generated keys.
`void` `initialize(Table table)` Initializes processing of the specified table.
`void` `nextRow()` Clears unsaved information about previous row, if any.
`java.lang.String` `toString()`

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

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

### Constructor Detail

#### GeneratedKeys

    public GeneratedKeys()

### Method Detail

#### add

    public void add(Column column)

Remembers columns with generated keys.

Parameters:
  `column` - table column

#### clear

    public void clear(java.lang.Object generatedKeysRequest)

Clears all information from previous runs and sets a new request for gathering of generated keys.

Parameters:
  `generatedKeysRequest` - `false` if generated keys are not needed, `true` if generated keys should be configured automatically, `int[]` to specify column indices to return generated keys from, or `String[]` to specify column names to return generated keys from

#### confirmRow

    public void confirmRow(Row tableRow)

Saves row with generated keys if any.

Parameters:
  `tableRow` - table row that was inserted

#### getKeys

    public LocalResult getKeys(Session session)

Returns generated keys.

Parameters:
  `session` - session
Returns:
  local result with generated keys

#### initialize

    public void initialize(Table table)

Initializes processing of the specified table. Should be called after `clear()`, but before other methods.

Parameters:
  `table` - table

#### nextRow

    public void nextRow()

Clears unsaved information about previous row, if any. Should be called before processing of a new row if previous row was not confirmed or simply always before each row.

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`