java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.seasar.doma.DomaException
org.seasar.doma.jdbc.JdbcException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConfigException,DaoMethodNotFoundException,DomainTypeNotFoundException,DuplicateColumnException,EmptyWhereClauseException,EntityPropertyAccessException,EntityPropertyNotDefinedException,EntityPropertyNotFoundException,EntityTypeNotFoundException,JdbcUnsupportedOperationException,NonSingleColumnException,NonUniqueResultException,NoResultException,OptimisticLockException,OriginalStatesAccessException,OriginalStatesNotFoundException,ResultMappingException,SavepointAlreadyExistsException,SavepointNotFoundException,ScriptException,ScriptFileNotFoundException,SqlExecutionException,SqlFileNotFoundException,TransactionAlreadyBegunException,TransactionNotYetBegunException,UniqueConstraintException,UnknownColumnException
Thrown to indicate a JDBC related error during database operations.
This is the base exception class for all JDBC-related exceptions in Doma. It provides common functionality for handling SQL-related errors and formatting SQL statements for error messages.
Specific subclasses provide more detailed information about particular types of JDBC errors, such as SQL syntax errors, constraint violations, or mapping problems.
-
Field Summary
Fields inherited from class org.seasar.doma.DomaException
args, messageResource -
Constructor Summary
ConstructorsConstructorDescriptionJdbcException(MessageResource messageCode, Object... args) Constructs a new JdbcException with the specified message code and arguments.JdbcException(MessageResource messageCode, Throwable cause, Object... args) Constructs a new JdbcException with the specified message code, cause, and arguments. -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringchoiceSql(SqlLogType logType, String rawSql, String formattedSql) Chooses the SQL string for logging depending on the log typeMethods inherited from class org.seasar.doma.DomaException
getArgs, getMessageResourceMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
JdbcException
Constructs a new JdbcException with the specified message code and arguments.- Parameters:
messageCode- the message code that identifies the error messageargs- the arguments to format the error message
-
JdbcException
Constructs a new JdbcException with the specified message code, cause, and arguments.- Parameters:
messageCode- the message code that identifies the error messagecause- the cause of this exceptionargs- the arguments to format the error message
-
-
Method Details
-
choiceSql
Chooses the SQL string for logging depending on the log type- Parameters:
logType- the log typerawSql- the raw SQL stringformattedSql- the formatted SQL string- Returns:
- the SQL string
-