Top Description Fields Constructors Methods
org.hibernate.exception

public Class ConstraintViolationException

extends JDBCException
Class Inheritance
Imports
java.sql.SQLException, org.hibernate.JDBCException, org.checkerframework.checker.nullness.qual.Nullable

A JDBCException indicating that the requested DML operation resulted in violation of a defined integrity constraint.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final @Nullable String

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public @Nullable String

Returns:

The name of the violated constraint, or null if not known.
getConstraintName
()

Returns the name of the violated constraint, if known.

Inherited from org.hibernate.JDBCException:
getErrorCodegetErrorMessagegetSQLgetSQLExceptiongetSQLState

Field Detail

constraintNameback to summary
private final @Nullable String constraintName

Constructor Detail

ConstraintViolationExceptionback to summary
public ConstraintViolationException(String message, SQLException root, @Nullable String constraintName)
ConstraintViolationExceptionback to summary
public ConstraintViolationException(String message, SQLException root, String sql, @Nullable String constraintName)

Method Detail

getConstraintNameback to summary
public @Nullable String getConstraintName()

Returns the name of the violated constraint, if known.

Returns:@Nullable String

The name of the violated constraint, or null if not known.