Enum Class UpsertRenderContexts

java.lang.Object
java.lang.Enum<UpsertRenderContexts>
org.springframework.data.relational.core.sql.render.UpsertRenderContexts
All Implemented Interfaces:
Serializable, Comparable<UpsertRenderContexts>, Constable, UpsertRenderContext

public enum UpsertRenderContexts extends Enum<UpsertRenderContexts> implements UpsertRenderContext
Since:
4.1
Author:
Christoph Strobl, Mark Paluch
  • Enum Constant Details

    • MYSQL

      public static final UpsertRenderContexts MYSQL
      MySQL / MariaDB upsert using INSERT ... ON DUPLICATE KEY UPDATE.
    • ORACLE

      public static final UpsertRenderContexts ORACLE
      Oracle MERGE upsert. Uses SELECT ... FROM DUAL for source values.
    • SQL_SERVER

      public static final UpsertRenderContexts SQL_SERVER
      SQL Server MERGE upsert. The statement body matches UpsertStatementRenderers.Merge with a trailing semicolon.
    • MERGE

      public static final UpsertRenderContexts MERGE
      Standard SQL MERGE upsert for dialects that support it (like H2, HSQLDB, SQL Server, DB2).

      Uses a table value constructor (VALUES (?, ?)) AS s (col1, col2) as the source so that no SELECT is used.c

    • UNSUPPORTED

      public static final UpsertRenderContexts UNSUPPORTED
      Unsupported dialect.
  • Method Details

    • values

      public static UpsertRenderContexts[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UpsertRenderContexts valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • supportsUpsert

      public boolean supportsUpsert()
      Specified by:
      supportsUpsert in interface UpsertRenderContext
      Returns:
      true if the database supports upsert.