# Class DeleteDenyException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.cayenne.CayenneRuntimeException
org.apache.cayenne.DeleteDenyException

All Implemented Interfaces:
  `Serializable`

public class DeleteDenyException extends CayenneRuntimeException
An exception thrown during an attempt to delete an object that has a relationship to a non-null related object, that has a DENY delete rule.

Since:
  1.2
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Persistent`
  `object`
  `protected String`
  `relationship`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DeleteDenyException()`
  `DeleteDenyException(String message)`
  `DeleteDenyException(Persistent object, String relationship, String reason)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getMessage()`
  Returns message that includes Cayenne version label and the actual exception message.
  `Persistent`
  `getObject()`
  `String`
  `getRelationship()`

  ### Methods inherited from class CayenneRuntimeException

  `getExceptionLabel, getUnlabeledMessage`

  ### Methods inherited from class Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### object

    protected Persistent object

  - ### relationship

    protected String relationship

- ## Constructor Details

  - ### DeleteDenyException

    public DeleteDenyException()

  - ### DeleteDenyException

    public DeleteDenyException(String message)

  - ### DeleteDenyException

    public DeleteDenyException(Persistent object, String relationship, String reason)
    Since:
      1.2

- ## Method Details

  - ### getObject

    public Persistent getObject()
    Since:
      1.2

  - ### getRelationship

    public String getRelationship()
    Since:
      1.2

  - ### getMessage

    public String getMessage()
    Description copied from class: `CayenneRuntimeException`
    Returns message that includes Cayenne version label and the actual exception message.
    Overrides:
      `getMessage` in class `CayenneRuntimeException`