Module io.ebean.api
Package io.ebean

Interface InsertOptions


public interface InsertOptions
Options to be used with insert such as ON CONFLICT DO UPDATE | NOTHING.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    The builder for InsertOptions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final InsertOptions
    Use ON CONFLICT DO NOTHING with automatic determination of the unique columns to conflict on.
    static final InsertOptions
    Use ON CONFLICT UPDATE with automatic determination of the unique columns to conflict on.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return a builder for InsertOptions.
    Return the constraint name that is used for ON CONFLICT.
    Return if GetGeneratedKeys should be used to fetch the generated keys after insert.
    key()
    Return the key for these build options.
    Return the unique columns that is used for ON CONFLICT.
    Return the ON CONFLICT UPDATE SET clause.
  • Field Details

    • ON_CONFLICT_UPDATE

      static final InsertOptions ON_CONFLICT_UPDATE
      Use ON CONFLICT UPDATE with automatic determination of the unique columns to conflict on.

      Uses mapping to determine the unique columns - @Column(unique=true) and @Index(unique=true) .

    • ON_CONFLICT_NOTHING

      static final InsertOptions ON_CONFLICT_NOTHING
      Use ON CONFLICT DO NOTHING with automatic determination of the unique columns to conflict on.

      Uses mapping to determine the unique columns - @Column(unique=true) and @Index(unique=true) .

  • Method Details

    • builder

      static InsertOptions.Builder builder()
      Return a builder for InsertOptions.
    • constraint

      @Nullable String constraint()
      Return the constraint name that is used for ON CONFLICT.
    • uniqueColumns

      @Nullable String uniqueColumns()
      Return the unique columns that is used for ON CONFLICT.

      When not explicitly set will use mapping like @Column(unique=true) to determine the non-unique columns.

    • updateSet

      @Nullable String updateSet()
      Return the ON CONFLICT UPDATE SET clause.

      When not set will use the non-unique columns.

    • getGetGeneratedKeys

      @Nullable Boolean getGetGeneratedKeys()
      Return if GetGeneratedKeys should be used to fetch the generated keys after insert.
    • key

      String key()
      Return the key for these build options.