Class CayenneSqlException

All Implemented Interfaces:
Serializable

public class CayenneSqlException extends CayenneRuntimeException
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 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

      public Query getQuery()
      Returns the query that was being executed when the failure occurred, or null if it is not known.
    • getStatement

      public TranslatedStatement getStatement()
      Returns the statement that was being executed when the failure occurred, or null if it is not known.