public enum ConflictClause extends java.lang.Enum<ConflictClause>
An annotation that indicates a constraint should use a specified behavior upon encountering a conflict. May be used
with NotNull and Unique.
http://www.sqlite.org/lang_conflict.html http://www.sqlite.org/syntaxdiagrams.html#column-constraint
| Enum Constant and Description |
|---|
ABORT
When an applicable constraint violation occurs, the ABORT resolution algorithm aborts the current SQL statement
with an SQLITE_CONSTRAINT error and backs out any changes made by the current SQL statement; but changes caused
by prior SQL statements within the same transaction are preserved and the transaction remains active.
|
FAIL
When an applicable constraint violation occurs, the FAIL resolution algorithm aborts the current SQL statement
with an SQLITE_CONSTRAINT error.
|
IGNORE
When an applicable constraint violation occurs, the IGNORE resolution algorithm skips the one row that contains
the constraint violation and continues processing subsequent rows of the SQL statement as if nothing went wrong
.
|
NONE
Do not specify a conflict clause.
|
REPLACE
When a UNIQUE or PRIMARY KEY constraint violation occurs, the REPLACE algorithm deletes pre-existing rows that
are causing the constraint violation prior to inserting or updating the current row and the command continues
executing normally.
|
ROLLBACK
When an applicable constraint violation occurs, the ROLLBACK resolution algorithm aborts the current SQL
statement with an SQLITE_CONSTRAINT error and rolls back the current transaction.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
keyword()
Returns a keyword string for the conflict clause.
|
static ConflictClause |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ConflictClause[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConflictClause NONE
public static final ConflictClause ROLLBACK
public static final ConflictClause ABORT
public static final ConflictClause FAIL
public static final ConflictClause IGNORE
public static final ConflictClause REPLACE
When a UNIQUE or PRIMARY KEY constraint violation occurs, the REPLACE algorithm deletes pre-existing rows that are causing the constraint violation prior to inserting or updating the current row and the command continues executing normally. If a NOT NULL constraint violation occurs, the REPLACE conflict resolution replaces the NULL value with the default value for that column, or if the column has no default value, then the ABORT algorithm is used. If a CHECK constraint violation occurs, the REPLACE conflict resolution algorithm always works like ABORT.
When the REPLACE conflict resolution strategy deletes rows in order to satisfy a constraint, delete triggers fire if and only if recursive triggers are enabled.
The update hook is not invoked for rows that are deleted by the REPLACE conflict resolution strategy. Nor does REPLACE increment the change counter. The exceptional behaviors defined in this paragraph might change in a future release.
public static ConflictClause[] values()
for (ConflictClause c : ConflictClause.values()) System.out.println(c);
public static ConflictClause valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.String keyword()