ConstraintViolationException
class ConstraintViolationException(val messageEnum: ConstraintViolationExceptionMessage, val tableName: String? = null, val columnName: String? = null, val constraintName: String? = null, queryContext: QueryContext?, cause: Throwable?) : DatabaseException
Exception thrown when a database operation violates data integrity constraints.
This is a common exception for handling domain rules enforced by the database (e.g., "Email already exists" or "Referenced user not found").
It provides metadata like tableName, columnName, and constraintName if provided by the database driver.
Constructors
Link copied to clipboard
constructor(messageEnum: ConstraintViolationExceptionMessage, tableName: String? = null, columnName: String? = null, constraintName: String? = null, queryContext: QueryContext?, cause: Throwable?)