Package org.hibernate

Class QueryException

    • Constructor Detail

      • QueryException

        @Deprecated(since="6.3")
        public QueryException​(String message)
        Deprecated.
        this constructor does not carry information about the query which caused the failure
        Constructs a QueryException using the specified exception message.
        Parameters:
        message - A message explaining the exception condition
      • QueryException

        @Deprecated(since="6.3")
        public QueryException​(String message,
                              Exception cause)
        Deprecated.
        this constructor does not carry information about the query which caused the failure
        Constructs a QueryException using the specified exception message and cause.
        Parameters:
        message - A message explaining the exception condition
        cause - The underlying cause
      • QueryException

        public QueryException​(String message,
                              String queryString)
        Constructs a QueryException using the specified exception message and query string.
        Parameters:
        message - A message explaining the exception condition
        queryString - The query being evaluated when the exception occurred
      • QueryException

        public QueryException​(String message,
                              String queryString,
                              Exception cause)
        Constructs a QueryException using the specified exception message and query string.
        Parameters:
        message - A message explaining the exception condition
        queryString - The query being evaluated when the exception occurred
        cause - The underlying cause
      • QueryException

        @Deprecated(since="6.3")
        public QueryException​(Exception cause)
        Deprecated.
        this constructor does not carry information about the query which caused the failure
        Constructs a QueryException using the specified cause.
        Parameters:
        cause - The underlying cause
    • Method Detail

      • getQueryString

        public String getQueryString()
        Retrieve the query being evaluated when the exception occurred. May be null, but generally should not be.
        Returns:
        The query string
      • getOriginalMessage

        protected final String getOriginalMessage()
      • wrapWithQueryString

        @Deprecated(since="6.2",
                    forRemoval=true)
        public final QueryException wrapWithQueryString​(String queryString)
        Deprecated, for removal: This API element is subject to removal in a future version.
        This method is no longer used
        Wraps this exception with another, of same kind, with the specified query string. If this exception already has a query string defined, the same exception (this) is returned. Otherwise, the protected generateQueryException(String) is called, to allow subclasses to properly create the correct subclass for return.
        Parameters:
        queryString - The query string that led to the QueryException
        Returns:
        this, if this has null for getQueryString(); otherwise a new QueryException (or subclass) is returned.