Class DataAccessException

All Implemented Interfaces:
Serializable

public class DataAccessException extends UltiToolsException
Exception thrown when data access operations fail.

This includes database connection errors, query failures, entity not found, etc.

Since:
6.2.0
Author:
wisdomme
See Also:
  • Constructor Details

    • DataAccessException

      public DataAccessException(String message)
      Creates a new data access exception with a generic error code.
      Parameters:
      message - the error message
    • DataAccessException

      public DataAccessException(ErrorCode errorCode, String message)
      Creates a new data access exception with a specific error code.
      Parameters:
      errorCode - the error code
      message - the error message
    • DataAccessException

      public DataAccessException(String message, Throwable cause)
      Creates a new data access exception with message and cause.
      Parameters:
      message - the error message
      cause - the underlying cause
    • DataAccessException

      public DataAccessException(ErrorCode errorCode, String message, Throwable cause)
      Creates a new data access exception with error code, message, and cause.
      Parameters:
      errorCode - the error code
      message - the error message
      cause - the underlying cause
  • Method Details

    • entityNotFound

      public static DataAccessException entityNotFound(Class<?> entityType, Object identifier)
      Creates an exception for entity not found scenarios.
      Parameters:
      entityType - the type of entity that was not found
      identifier - the identifier used to look up the entity
      Returns:
      a new DataAccessException
    • connectionFailed

      public static DataAccessException connectionFailed(Throwable cause)
      Creates an exception for database connection failures.
      Parameters:
      cause - the underlying cause
      Returns:
      a new DataAccessException
    • queryFailed

      public static DataAccessException queryFailed(String query, Throwable cause)
      Creates an exception for query failures.
      Parameters:
      query - the query that failed
      cause - the underlying cause
      Returns:
      a new DataAccessException