public class MetadataException
extends java.sql.SQLException
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
METADATA_CACHE_FAILED_STATE |
static java.lang.String |
METADATA_LOAD_FAILED_STATE |
static java.lang.String |
METADATA_LOOKUP_FAILED_STATE |
static java.lang.String |
METADATA_REFRESH_FAILED_STATE |
static java.lang.String |
METADATA_VALIDATION_FAILED_STATE |
| Constructor and Description |
|---|
MetadataException(java.lang.String message)
Constructs a MetadataException with the specified detail message.
|
MetadataException(java.lang.String message,
java.lang.String sqlState,
int vendorCode,
java.lang.Throwable cause)
Constructs a MetadataException with the specified detail message, cause, SQL state, and vendor
code.
|
MetadataException(java.lang.String message,
java.lang.String sqlState,
java.lang.Throwable cause)
Constructs a MetadataException with the specified detail message, SQL state and cause.
|
MetadataException(java.lang.String message,
java.lang.Throwable cause)
Constructs a MetadataException with the specified detail message and cause.
|
MetadataException(java.lang.Throwable cause)
Constructs a MetadataException with the specified cause.
|
| Modifier and Type | Method and Description |
|---|---|
static MetadataException |
cacheFailed(java.lang.String message,
java.lang.Throwable cause)
Creates a MetadataException for cache operation failures.
|
java.lang.String |
getDetailedMessage()
Gets a formatted error message including context information.
|
java.util.Map<java.lang.String,java.lang.Object> |
getErrorContext()
Gets the error context map.
|
static MetadataException |
loadFailed(java.lang.String message,
java.lang.Throwable cause)
Creates a MetadataException for metadata loading failures.
|
static MetadataException |
lookupFailed(java.lang.String tableName,
java.lang.String columnName,
java.lang.Throwable cause)
Creates a MetadataException for metadata lookup failures.
|
static MetadataException |
refreshFailed(java.lang.String message,
java.lang.Throwable cause)
Creates a MetadataException for metadata refresh failures.
|
static MetadataException |
validationFailed(java.lang.String message)
Creates a MetadataException for metadata validation failures.
|
MetadataException |
withCacheInfo(int cacheSize,
boolean cacheHit)
Adds cache information to the error context.
|
MetadataException |
withColumn(java.lang.String columnName)
Adds column name to the error context.
|
MetadataException |
withContext(java.lang.String key,
java.lang.Object value)
Adds context information to the exception.
|
MetadataException |
withOperation(java.lang.String operation)
Adds operation type to the error context.
|
MetadataException |
withSql(java.lang.String sql)
Adds SQL query information to the error context (sanitized).
|
MetadataException |
withTable(java.lang.String tableName)
Adds table name to the error context.
|
getErrorCode, getNextException, getSQLState, iterator, setNextExceptionaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic static final java.lang.String METADATA_LOAD_FAILED_STATE
public static final java.lang.String METADATA_CACHE_FAILED_STATE
public static final java.lang.String METADATA_REFRESH_FAILED_STATE
public static final java.lang.String METADATA_LOOKUP_FAILED_STATE
public static final java.lang.String METADATA_VALIDATION_FAILED_STATE
public MetadataException(java.lang.String message)
message - the detail messagepublic MetadataException(java.lang.String message,
java.lang.Throwable cause)
message - the detail messagecause - the cause of this exceptionpublic MetadataException(java.lang.Throwable cause)
cause - the cause of this exceptionpublic MetadataException(java.lang.String message,
java.lang.String sqlState,
int vendorCode,
java.lang.Throwable cause)
message - the detail messagesqlState - the SQL statevendorCode - the vendor-specific error codecause - the cause of this exceptionpublic MetadataException(java.lang.String message,
java.lang.String sqlState,
java.lang.Throwable cause)
message - the detail messagesqlState - the SQL statecause - the cause of this exceptionpublic MetadataException withContext(java.lang.String key, java.lang.Object value)
key - the context keyvalue - the context valuepublic MetadataException withTable(java.lang.String tableName)
tableName - the table namepublic MetadataException withColumn(java.lang.String columnName)
columnName - the column namepublic MetadataException withOperation(java.lang.String operation)
operation - the operation being performedpublic MetadataException withCacheInfo(int cacheSize, boolean cacheHit)
cacheSize - the current cache sizecacheHit - whether this was a cache hit or misspublic MetadataException withSql(java.lang.String sql)
sql - the SQL querypublic java.util.Map<java.lang.String,java.lang.Object> getErrorContext()
public java.lang.String getDetailedMessage()
public static MetadataException loadFailed(java.lang.String message, java.lang.Throwable cause)
message - Error messagecause - Root causepublic static MetadataException cacheFailed(java.lang.String message, java.lang.Throwable cause)
message - Error messagecause - Root causepublic static MetadataException refreshFailed(java.lang.String message, java.lang.Throwable cause)
message - Error messagecause - Root causepublic static MetadataException lookupFailed(java.lang.String tableName, java.lang.String columnName, java.lang.Throwable cause)
tableName - Table namecolumnName - Column namecause - Root causepublic static MetadataException validationFailed(java.lang.String message)
message - Error message