パッケージ org.springframework.dao

クラス DataIntegrityViolationException

実装されたすべてのインターフェース:
SerializableSE
既知の直属サブクラス
DuplicateKeyException

public class DataIntegrityViolationException extends NonTransientDataAccessException
SQL ステートメントの実行が指定されたデータのマッピングに失敗したときにスローされる例外です。通常は、データの挿入や更新に限らないものの、整合性制約違反が発生します。これは純粋なリレーショナル概念ではないことに注意してください。一意の主キーなどの整合性制約は、ほとんどのデータベース型で必要です。

より具体的な例外のスーパークラスとして機能します。DuplicateKeyException。ただし、一般的には、特定の例外サブクラスに依存するのではなく、DataIntegrityViolationException 自体を処理することをお勧めします。

作成者:
Rod Johnson
関連事項:
  • コンストラクターの詳細

    • DataIntegrityViolationException

      public DataIntegrityViolationException(@Nullable StringSE msg)
      DataIntegrityViolationException のコンストラクター。
      パラメーター:
      msg - 詳細メッセージ
    • DataIntegrityViolationException

      public DataIntegrityViolationException(@Nullable StringSE msg, @Nullable ThrowableSE cause)
      DataIntegrityViolationException のコンストラクター。
      パラメーター:
      msg - 詳細メッセージ
      cause - 使用中のデータアクセス API の根本原因