Package com.mckoi.database
Class DatabaseConstraintViolationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.mckoi.database.DatabaseConstraintViolationException
-
- All Implemented Interfaces:
java.io.Serializable
public class DatabaseConstraintViolationException extends java.lang.RuntimeException
A database exception that represents a constraint violation.- Author:
- Tobias Downer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
CHECK_VIOLATION
A Check constraint violation error code.static int
DROP_COLUMN_VIOLATION
Column can't be dropped before of an reference to it.static int
DROP_TABLE_VIOLATION
Tried to drop a table that is referenced by another source.static int
FOREIGN_KEY_VIOLATION
A Foreign Key constraint violation error code.static int
JAVA_TYPE_VIOLATION
Java type constraint violation error code (tried to insert a Java object that wasn't derived from the java object type defined for the column).static int
NULLABLE_VIOLATION
A Nullable constraint violation error code (data added to not null columns that was null).static int
PRIMARY_KEY_VIOLATION
A Primary Key constraint violation error code.static int
UNIQUE_VIOLATION
A Unique constraint violation error code.
-
Constructor Summary
Constructors Constructor Description DatabaseConstraintViolationException(int err_code, java.lang.String msg)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getErrorCode()
Returns the violation error code.
-
-
-
Field Detail
-
PRIMARY_KEY_VIOLATION
public static final int PRIMARY_KEY_VIOLATION
A Primary Key constraint violation error code.- See Also:
- Constant Field Values
-
UNIQUE_VIOLATION
public static final int UNIQUE_VIOLATION
A Unique constraint violation error code.- See Also:
- Constant Field Values
-
CHECK_VIOLATION
public static final int CHECK_VIOLATION
A Check constraint violation error code.- See Also:
- Constant Field Values
-
FOREIGN_KEY_VIOLATION
public static final int FOREIGN_KEY_VIOLATION
A Foreign Key constraint violation error code.- See Also:
- Constant Field Values
-
NULLABLE_VIOLATION
public static final int NULLABLE_VIOLATION
A Nullable constraint violation error code (data added to not null columns that was null).- See Also:
- Constant Field Values
-
JAVA_TYPE_VIOLATION
public static final int JAVA_TYPE_VIOLATION
Java type constraint violation error code (tried to insert a Java object that wasn't derived from the java object type defined for the column).- See Also:
- Constant Field Values
-
DROP_TABLE_VIOLATION
public static final int DROP_TABLE_VIOLATION
Tried to drop a table that is referenced by another source.- See Also:
- Constant Field Values
-
DROP_COLUMN_VIOLATION
public static final int DROP_COLUMN_VIOLATION
Column can't be dropped before of an reference to it.- See Also:
- Constant Field Values
-
-