SQLJet Home

org.tmatesoft.sqljet.core.schema
Enum SqlJetConflictAction

java.lang.Object
  extended by java.lang.Enum<SqlJetConflictAction>
      extended by org.tmatesoft.sqljet.core.schema.SqlJetConflictAction
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SqlJetConflictAction>

public enum SqlJetConflictAction
extends java.lang.Enum<SqlJetConflictAction>

"ON CONFLICT" action.

Author:
TMate Software Ltd., Dmitry Stadnik (dtrace@seznam.cz)

Enum Constant Summary
ABORT
          When a constraint violation occurs, the command backs out any prior changes it might have made and aborts with a return code of SQLITE_CONSTRAINT.
FAIL
          When a constraint violation occurs, the command aborts with a return code SQLITE_CONSTRAINT.
IGNORE
          When a constraint violation occurs, the one row that contains the constraint violation is not inserted or changed.
REPLACE
          When a UNIQUE constraint violation occurs, the pre-existing rows that are causing the constraint violation are removed prior to inserting or updating the current row.
ROLLBACK
          When a constraint violation occurs, an immediate ROLLBACK occurs, thus ending the current transaction, and the command aborts with a return code of SQLITE_CONSTRAINT.
 
Method Summary
static SqlJetConflictAction decode(java.lang.String s)
           
 java.lang.String toString()
           
static SqlJetConflictAction valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SqlJetConflictAction[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ROLLBACK

public static final SqlJetConflictAction ROLLBACK
When a constraint violation occurs, an immediate ROLLBACK occurs, thus ending the current transaction, and the command aborts with a return code of SQLITE_CONSTRAINT. If no transaction is active (other than the implied transaction that is created on every command) then this algorithm works the same as ABORT.


ABORT

public static final SqlJetConflictAction ABORT
When a constraint violation occurs, the command backs out any prior changes it might have made and aborts with a return code of SQLITE_CONSTRAINT. But no ROLLBACK is executed so changes from prior commands within the same transaction are preserved. This is the default behavior.


FAIL

public static final SqlJetConflictAction FAIL
When a constraint violation occurs, the command aborts with a return code SQLITE_CONSTRAINT. But any changes to the database that the command made prior to encountering the constraint violation are preserved and are not backed out. For example, if an UPDATE statement encountered a constraint violation on the 100th row that it attempts to update, then the first 99 row changes are preserved but changes to rows 100 and beyond never occur.


IGNORE

public static final SqlJetConflictAction IGNORE
When a constraint violation occurs, the one row that contains the constraint violation is not inserted or changed. But the command continues executing normally. Other rows before and after the row that contained the constraint violation continue to be inserted or updated normally. No error is returned.


REPLACE

public static final SqlJetConflictAction REPLACE
When a UNIQUE constraint violation occurs, the pre-existing rows that are causing the constraint violation are removed prior to inserting or updating the current row. Thus the insert or update always occurs. The command continues executing normally. No error is returned. If a NOT NULL constraint violation occurs, the NULL value is replaced by the default value for that column. If the column has no default value, then the ABORT algorithm is used. If a CHECK constraint violation occurs then the IGNORE algorithm is used. When this conflict resolution strategy deletes rows in order to satisfy a constraint, it does not invoke delete triggers on those rows. Nor is the update hook invoked. The exceptional behaviors defined in this paragraph might change in a future release.

Method Detail

values

public static SqlJetConflictAction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SqlJetConflictAction c : SqlJetConflictAction.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SqlJetConflictAction valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

decode

public static SqlJetConflictAction decode(java.lang.String s)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<SqlJetConflictAction>

SQLJet Home

Copyright © 2009-2010 TMate Software Ltd. All Rights Reserved.