Package com.orchestranetworks.schema

# Class ConstraintViolationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
com.orchestranetworks.schema.ConstraintViolationException

All Implemented Interfaces:
  `Serializable`

public class ConstraintViolationException extends IllegalArgumentException
Thrown to indicate that an insert, an update or a delete is not valid with respect to a blocking constraint.

See Also:
  - `ProcedureContext.setBlockingConstraintsDisabled(boolean)`
  - `ProcedureResult.getConstraintViolationException()`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConstraintViolationException(UserMessage aMessage)`
  `ConstraintViolationException(UserMessage aMessage, SchemaFacet aFacet)`
  `ConstraintViolationException(UserMessage aMessage, SchemaNode aNode, SchemaFacet aFacet)`
  `ConstraintViolationException(String XPathExpression, UserMessage message, SchemaNode node, SchemaFacet facet)`
  `ConstraintViolationException(String aMessage, SchemaNode aNode, SchemaFacet aFacet)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SchemaFacet`
  `getFacet()`
  Returns the facet associated with the constraint violated.
  `SchemaNode`
  `getNode()`
  Returns the node associated with the constraint violated.
  `UserMessage`
  `getUserMessage()`
  Returns the user message associated with this exception.
  `String`
  `getXPathExpression()`
  Returns an XPath expression specifying the entity with which this exception is associated.
  `String`
  `toString()`
  Returns a string representation of the localized message defined by this exception.

  ### Methods inherited from class java.lang.Throwable

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

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### ConstraintViolationException

    public ConstraintViolationException(String XPathExpression, UserMessage message, SchemaNode node, SchemaFacet facet)

  - ### ConstraintViolationException

    public ConstraintViolationException(UserMessage aMessage)

  - ### ConstraintViolationException

    public ConstraintViolationException(UserMessage aMessage, SchemaNode aNode, SchemaFacet aFacet)

  - ### ConstraintViolationException

    public ConstraintViolationException(String aMessage, SchemaNode aNode, SchemaFacet aFacet)

  - ### ConstraintViolationException

    public ConstraintViolationException(UserMessage aMessage, SchemaFacet aFacet)

- ## Method Details

  - ### getUserMessage

    public UserMessage getUserMessage()
    Returns the user message associated with this exception.

  - ### getNode

    public SchemaNode getNode()
    Returns the node associated with the constraint violated. The node can be `null` if this exception is raised during the following actions:
    - Attempt to delete a record referenced by a foreign key constraint,
    - Attempt to delete a dataset referenced by a foreign key constraint,
    - Attempt to close a dataspace or snapshot referenced by a foreign key constraint.

  - ### getFacet

    public SchemaFacet getFacet()
    Returns the facet associated with the constraint violated. Returns `null` if this exception is raised:
    - during the attempt to close a dataspace or snapshot referenced by a foreign key constraint.
    - during the attempt to create a record in the target table of an association that does not comply with the filter defined by the association.

  - ### getXPathExpression

    public String getXPathExpression()
    Returns an XPath expression specifying the entity with which this exception is associated. The XPath expression can be `null` if this exception is raised while attempting to close a dataspace or snapshot referenced by a foreign key constraint.

  - ### toString

    public String toString()
    Returns a string representation of the localized message defined by this exception.
    Overrides:
      `toString` in class `Throwable`