Class DatabaseConstraintViolationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.mckoi.database.DatabaseConstraintViolationException
All Implemented Interfaces:
Serializable

public class DatabaseConstraintViolationException extends RuntimeException
A database exception that represents a constraint violation.
Author:
Tobias Downer
See Also:
  • Field Details

    • PRIMARY_KEY_VIOLATION

      public static final int PRIMARY_KEY_VIOLATION
      A Primary Key constraint violation error code.
      See Also:
    • UNIQUE_VIOLATION

      public static final int UNIQUE_VIOLATION
      A Unique constraint violation error code.
      See Also:
    • CHECK_VIOLATION

      public static final int CHECK_VIOLATION
      A Check constraint violation error code.
      See Also:
    • FOREIGN_KEY_VIOLATION

      public static final int FOREIGN_KEY_VIOLATION
      A Foreign Key constraint violation error code.
      See Also:
    • 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:
    • 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:
    • DROP_TABLE_VIOLATION

      public static final int DROP_TABLE_VIOLATION
      Tried to drop a table that is referenced by another source.
      See Also:
    • DROP_COLUMN_VIOLATION

      public static final int DROP_COLUMN_VIOLATION
      Column can't be dropped before of an reference to it.
      See Also:
  • Constructor Details

    • DatabaseConstraintViolationException

      public DatabaseConstraintViolationException(int err_code, String msg)
      Constructor.
  • Method Details

    • getErrorCode

      public int getErrorCode()
      Returns the violation error code.