Class DataAccessException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.ultikits.ultitools.exceptions.UltiToolsException
com.ultikits.ultitools.exceptions.DataAccessException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionDataAccessException(ErrorCode errorCode, String message) Creates a new data access exception with a specific error code.DataAccessException(ErrorCode errorCode, String message, Throwable cause) Creates a new data access exception with error code, message, and cause.DataAccessException(String message) Creates a new data access exception with a generic error code.DataAccessException(String message, Throwable cause) Creates a new data access exception with message and cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataAccessExceptionconnectionFailed(Throwable cause) Creates an exception for database connection failures.static DataAccessExceptionentityNotFound(Class<?> entityType, Object identifier) Creates an exception for entity not found scenarios.static DataAccessExceptionqueryFailed(String query, Throwable cause) Creates an exception for query failures.Methods inherited from class UltiToolsException
getErrorCode, getFormattedMessage, toStringMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
DataAccessException
Creates a new data access exception with a generic error code.- Parameters:
message- the error message
-
DataAccessException
-
DataAccessException
-
DataAccessException
-
-
Method Details
-
entityNotFound
Creates an exception for entity not found scenarios.- Parameters:
entityType- the type of entity that was not foundidentifier- the identifier used to look up the entity- Returns:
- a new DataAccessException
-
connectionFailed
Creates an exception for database connection failures.- Parameters:
cause- the underlying cause- Returns:
- a new DataAccessException
-
queryFailed
Creates an exception for query failures.- Parameters:
query- the query that failedcause- the underlying cause- Returns:
- a new DataAccessException
-