public class QueryException extends HibernateException
Constructor and Description |
---|
QueryException(java.lang.Exception cause)
Constructs a QueryException using the specified cause.
|
QueryException(java.lang.String message)
Constructs a QueryException using the specified exception message.
|
QueryException(java.lang.String message,
java.lang.Exception cause)
Constructs a QueryException using the specified exception message and cause.
|
QueryException(java.lang.String message,
java.lang.String queryString)
Constructs a QueryException using the specified exception message and query-string.
|
QueryException(java.lang.String message,
java.lang.String queryString,
java.lang.Exception cause)
Constructs a QueryException using the specified exception message and query-string.
|
Modifier and Type | Method and Description |
---|---|
protected QueryException |
generateQueryException(java.lang.String queryString)
Called from
wrapWithQueryString(String) when we really need to generate a new QueryException
(or subclass). |
java.lang.String |
getMessage() |
protected java.lang.String |
getOriginalMessage() |
java.lang.String |
getQueryString()
Retrieve the query being evaluated when the exception occurred.
|
QueryException |
wrapWithQueryString(java.lang.String queryString)
Wraps this exception with another, of same kind, with the specified queryString.
|
public QueryException(java.lang.String message)
message
- A message explaining the exception conditionpublic QueryException(java.lang.String message, java.lang.Exception cause)
message
- A message explaining the exception conditioncause
- The underlying causepublic QueryException(java.lang.String message, java.lang.String queryString)
message
- A message explaining the exception conditionqueryString
- The query being evaluated when the exception occurredpublic QueryException(java.lang.String message, java.lang.String queryString, java.lang.Exception cause)
message
- A message explaining the exception conditionqueryString
- The query being evaluated when the exception occurredcause
- The underlying causepublic QueryException(java.lang.Exception cause)
cause
- The underlying causepublic java.lang.String getQueryString()
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
protected final java.lang.String getOriginalMessage()
public final QueryException wrapWithQueryString(java.lang.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(java.lang.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 © 2001-2018 Red Hat, Inc. All Rights Reserved.