Package org.apache.cayenne
Class CayenneSqlException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.cayenne.CayenneRuntimeException
org.apache.cayenne.CayenneSqlException
- All Implemented Interfaces:
Serializable
An exception thrown when a failure occurs while executing a query statement or reading its results. It carries the
Query being executed and the TranslatedStatement that was being executed at the time of the failure,
and includes the statement's SQL in the exception message, so that a failure can be correlated with a specific query.- Since:
- 5.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCayenneSqlException(String message, Query query, TranslatedStatement statement, Throwable cause) Creates an exception for a failure that happened while executing the provided query and statement. -
Method Summary
Modifier and TypeMethodDescriptiongetQuery()Returns the query that was being executed when the failure occurred, or null if it is not known.Returns the statement that was being executed when the failure occurred, or null if it is not known.Methods inherited from class org.apache.cayenne.CayenneRuntimeException
getExceptionLabel, getMessage, getUnlabeledMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CayenneSqlException
public CayenneSqlException(String message, Query query, TranslatedStatement statement, Throwable cause) Creates an exception for a failure that happened while executing the provided query and statement. The statement may be null if the failure occurred before a statement was translated.
-
-
Method Details
-
getQuery
Returns the query that was being executed when the failure occurred, or null if it is not known. -
getStatement
Returns the statement that was being executed when the failure occurred, or null if it is not known.
-