Class ConstraintException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ConstraintException
    extends PersistenceException
    Runtime exception thrown for database constraint violations.
    Author:
    harald
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstraintException()
      Constructs a new database constraint exception without a session and with null as its detail message.
      ConstraintException​(java.lang.String message)
      Constructs a new database constraint exception without a session with the specified detail message.
      ConstraintException​(java.lang.String message, java.lang.Throwable cause)
      Constructs a new database constraint exception without a session with the specified detail message and cause.
      ConstraintException​(org.tentackle.misc.Identifiable object)
      Constructs a new database constraint violation exception for a given pc object with null as its detail message.
      ConstraintException​(org.tentackle.misc.Identifiable object, java.lang.String message)
      Constructs a new database constraint violation exception for a given session with the specified detail message.
      ConstraintException​(org.tentackle.misc.Identifiable object, java.lang.String message, java.lang.Throwable cause)
      Constructs a new database constraint violation exception for a given session with the specified detail message and cause.
      ConstraintException​(org.tentackle.misc.Identifiable object, java.lang.Throwable cause)
      Constructs a new database constraint violation exception for a given session with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).
      ConstraintException​(Session session)
      Constructs a new database constraint violation exception for a given session with null as its detail message.
      ConstraintException​(Session session, java.lang.String message)
      Constructs a new database constraint violation exception for a given session with the specified detail message.
      ConstraintException​(Session session, java.lang.String message, java.lang.Throwable cause)
      Constructs a new database constraint violation exception for a given session with the specified detail message and cause.
      ConstraintException​(Session session, java.lang.Throwable cause)
      Constructs a new database constraint violation exception for a given session with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).
    • Constructor Detail

      • ConstraintException

        public ConstraintException​(Session session)
        Constructs a new database constraint violation exception for a given session with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
        Parameters:
        session - the session
      • ConstraintException

        public ConstraintException​(Session session,
                                   java.lang.String message)
        Constructs a new database constraint violation exception for a given session with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
        Parameters:
        session - the session
        message - the detail message. The detail message is saved for later retrieval by the PersistenceException.getMessage() method.
      • ConstraintException

        public ConstraintException​(Session session,
                                   java.lang.String message,
                                   java.lang.Throwable cause)
        Constructs a new database constraint violation exception for a given session with the specified detail message and cause.

        Note that the detail message associated with cause is not automatically incorporated in this constraint's detail message.

        Parameters:
        session - the session
        message - the detail message (which is saved for later retrieval by the PersistenceException.getMessage() method).
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
        Since:
        1.4
      • ConstraintException

        public ConstraintException​(Session session,
                                   java.lang.Throwable cause)
        Constructs a new database constraint violation exception for a given session with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for runtime exceptions that are little more than wrappers for other throwables.
        Parameters:
        session - the session
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
        Since:
        1.4
      • ConstraintException

        public ConstraintException​(org.tentackle.misc.Identifiable object)
        Constructs a new database constraint violation exception for a given pc object with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
        Parameters:
        object - the persistent object
      • ConstraintException

        public ConstraintException​(org.tentackle.misc.Identifiable object,
                                   java.lang.String message)
        Constructs a new database constraint violation exception for a given session with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
        Parameters:
        object - the persistent object
        message - the detail message. The detail message is saved for later retrieval by the PersistenceException.getMessage() method.
      • ConstraintException

        public ConstraintException​(org.tentackle.misc.Identifiable object,
                                   java.lang.String message,
                                   java.lang.Throwable cause)
        Constructs a new database constraint violation exception for a given session with the specified detail message and cause.

        Note that the detail message associated with cause is not automatically incorporated in this constraint's detail message.

        Parameters:
        object - the persistent object
        message - the detail message (which is saved for later retrieval by the PersistenceException.getMessage() method).
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
        Since:
        1.4
      • ConstraintException

        public ConstraintException​(org.tentackle.misc.Identifiable object,
                                   java.lang.Throwable cause)
        Constructs a new database constraint violation exception for a given session with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for runtime exceptions that are little more than wrappers for other throwables.
        Parameters:
        object - the persistent object
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
        Since:
        1.4
      • ConstraintException

        public ConstraintException()
        Constructs a new database constraint exception without a session and with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
      • ConstraintException

        public ConstraintException​(java.lang.String message)
        Constructs a new database constraint exception without a session with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
        Parameters:
        message - the detail message. The detail message is saved for later retrieval by the PersistenceException.getMessage() method.
      • ConstraintException

        public ConstraintException​(java.lang.String message,
                                   java.lang.Throwable cause)
        Constructs a new database constraint exception without a session with the specified detail message and cause.

        Note that the detail message associated with cause is not automatically incorporated in this runtime exception's detail message.

        Parameters:
        message - the detail message (which is saved for later retrieval by the PersistenceException.getMessage() method).
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)