public class QueryException extends HibernateException
Constructor and Description |
---|
QueryException(Exception cause)
Constructs a QueryException using the specified cause.
|
QueryException(String message)
Constructs a QueryException using the specified exception message.
|
QueryException(String message,
Exception cause)
Constructs a QueryException using the specified exception message and cause.
|
QueryException(String message,
String queryString)
Constructs a QueryException using the specified exception message and query-string.
|
QueryException(String message,
String queryString,
Exception cause)
Constructs a QueryException using the specified exception message and query-string.
|
Modifier and Type | Method and Description |
---|---|
protected QueryException |
generateQueryException(String queryString)
Called from
wrapWithQueryString(String) when we really need to generate a new QueryException
(or subclass). |
String |
getMessage() |
protected String |
getOriginalMessage() |
String |
getQueryString()
Retrieve the query being evaluated when the exception occurred.
|
QueryException |
wrapWithQueryString(String queryString)
Wraps this exception with another, of same kind, with the specified queryString.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public QueryException(String message)
message
- A message explaining the exception conditionpublic QueryException(String message, Exception cause)
message
- A message explaining the exception conditioncause
- The underlying causepublic QueryException(String message, String queryString)
message
- A message explaining the exception conditionqueryString
- The query being evaluated when the exception occurredpublic QueryException(String message, String queryString, Exception cause)
message
- A message explaining the exception conditionqueryString
- The query being evaluated when the exception occurredcause
- The underlying causepublic QueryException(Exception cause)
cause
- The underlying causepublic String getQueryString()
public String getMessage()
getMessage
in class Throwable
protected final String getOriginalMessage()
public final QueryException wrapWithQueryString(String queryString)
this
) is returned. Otherwise the protected
generateQueryException(String)
is called, to allow subclasses to properly create the correct
subclass for return.queryString
- The query string that led to the QueryExceptionthis
, if this
has null
for getQueryString()
; otherwise a new
QueryException (or subclass) is returned.protected QueryException generateQueryException(String queryString)
wrapWithQueryString(String)
when we really need to generate a new QueryException
(or subclass).
NOTE : implementors should take care to use getOriginalMessage()
for the message, not
getMessage()
queryString
- The query stringgetOriginalMessage()
Copyright © 2019 JBoss by Red Hat. All rights reserved.