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
- Since:
- 4.1
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionStandard SQLMERGEupsert for dialects that support it (like H2, HSQLDB, SQL Server, DB2).MySQL / MariaDB upsert usingINSERT ... ON DUPLICATE KEY UPDATE.Oracle MERGE upsert.SQL Server MERGE upsert.Unsupported dialect. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic UpsertRenderContextsReturns the enum constant of this class with the specified name.static UpsertRenderContexts[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MYSQL
MySQL / MariaDB upsert usingINSERT ... ON DUPLICATE KEY UPDATE. -
ORACLE
Oracle MERGE upsert. UsesSELECT ... FROM DUALfor source values. -
SQL_SERVER
SQL Server MERGE upsert. The statement body matchesUpsertStatementRenderers.Mergewith a trailing semicolon. -
MERGE
Standard SQLMERGEupsert 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
Unsupported dialect.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
supportsUpsert
public boolean supportsUpsert()- Specified by:
supportsUpsertin interfaceUpsertRenderContext- Returns:
- true if the database supports upsert.
-