Class InsertResult

java.lang.Object
org.litebridge.db.spi.update.UpdateResult
org.litebridge.db.spi.update.InsertResult

public final class InsertResult extends UpdateResult
The result of an insert operation performed on the database.

This class extends UpdateResult and adds the capability to hold any generated keys resulting from the insert operation.

Instances of this class encapsulate both the number of rows affected by the insert operation and optionally a list of generated keys, if applicable.

  • Constructor Details

    • InsertResult

      public InsertResult(int rowsAffected)
      Constructs an InsertResult instance representing the result of an insert operation performed on the database.
      Parameters:
      rowsAffected - The number of rows affected by the insert operation.
    • InsertResult

      public InsertResult(int rowsAffected, Map<ColumnMetaData,Object> generatedKeys)
      Constructs an InsertResult instance representing the result of an insert operation performed on the database.
      Parameters:
      rowsAffected - The number of rows affected by the insert operation.
      generatedKeys - A map of generated keys resulting from the insert operation.
  • Method Details

    • generatedKeys

      public Map<ColumnMetaData,Object> generatedKeys()
      Returns a map of generated keys resulting from the insert operation.
      Returns:
      A map of generated keys.
    • toString

      public String toString()
      Overrides:
      toString in class UpdateResult