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:
Serializable
A database exception that represents a constraint violation.
- Author:
- Tobias Downer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA Check constraint violation error code.static final intColumn can't be dropped before of an reference to it.static final intTried to drop a table that is referenced by another source.static final intA Foreign Key constraint violation error code.static final intJava 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 final intA Nullable constraint violation error code (data added to not null columns that was null).static final intA Primary Key constraint violation error code.static final intA Unique constraint violation error code. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
PRIMARY_KEY_VIOLATION
public static final int PRIMARY_KEY_VIOLATIONA Primary Key constraint violation error code.- See Also:
-
UNIQUE_VIOLATION
public static final int UNIQUE_VIOLATIONA Unique constraint violation error code.- See Also:
-
CHECK_VIOLATION
public static final int CHECK_VIOLATIONA Check constraint violation error code.- See Also:
-
FOREIGN_KEY_VIOLATION
public static final int FOREIGN_KEY_VIOLATIONA Foreign Key constraint violation error code.- See Also:
-
NULLABLE_VIOLATION
public static final int NULLABLE_VIOLATIONA Nullable constraint violation error code (data added to not null columns that was null).- See Also:
-
JAVA_TYPE_VIOLATION
public static final int JAVA_TYPE_VIOLATIONJava 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:
-
DROP_TABLE_VIOLATION
public static final int DROP_TABLE_VIOLATIONTried to drop a table that is referenced by another source.- See Also:
-
DROP_COLUMN_VIOLATION
public static final int DROP_COLUMN_VIOLATIONColumn can't be dropped before of an reference to it.- See Also:
-
-
Constructor Details
-
DatabaseConstraintViolationException
Constructor.
-
-
Method Details
-
getErrorCode
public int getErrorCode()Returns the violation error code.
-