public abstract class OnException extends ConditionalExecution implements Serializable
MergeHandler
,
Serialized FormModifier and Type | Field and Description |
---|---|
static Map<String,Integer> |
ON_EXCEPTION
The maps on exception types to actions.
|
static int |
ON_EXCEPTION_CONTINUE
The ON_EXCEPTION_CONTINUE action.
|
static String |
ON_EXCEPTION_CONTINUE_STR
The ON_EXCEPTION_CONTINUE type.
|
static int |
ON_EXCEPTION_IGNORE
The ON_EXCEPTION_IGNORE action.
|
static String |
ON_EXCEPTION_IGNORE_STR
The ON_EXCEPTION_IGNORE type.
|
static int |
ON_EXCEPTION_MERGE
The ON_EXCEPTION_MERGE action.
|
static String |
ON_EXCEPTION_MERGE_STR
The ON_EXCEPTION_MERGE type.
|
static int |
ON_EXCEPTION_RAISE
The ON_EXCEPTION_RAISE action.
|
static Integer |
ON_EXCEPTION_RAISE_KEY
The ON_EXCEPTION_RAISE action.
|
static String |
ON_EXCEPTION_RAISE_STR
The ON_EXCEPTION_RAISE type.
|
static Map<Integer,String> |
ON_EXCEPTION_TYPE
The maps on exception actions to types.
|
static int |
ON_PARSE_EXCEPTION
The ON_PARSE_EXCEPTION type.
|
static String |
ON_PARSE_EXCEPTION_STR
The ON_PARSE_EXCEPTION type.
|
Constructor and Description |
---|
OnException()
Instantiates a new OnException.
|
Modifier and Type | Method and Description |
---|---|
static int |
findException(String exception,
String message)
Finds the index of the exception handler.
|
List<Integer> |
getExceptionActions()
Gets the list "on exception" actions.
|
String |
getExceptionMask()
Gets the exception mask.
|
String |
getKeyFields()
Gets the name of the key fields.
|
String |
getMessage()
Gets the message displayed on exception.
|
String |
getName()
Gets the name.
|
int |
getOnExceptionAction()
Gets the on exception action.
|
int |
getOnExceptionActions(String type)
Parsers given type and creates a list of "on exception" actions.
|
int |
handleException(Connection conn,
String sql,
Exception ex,
long row,
MergeHandler mergeHandler,
InfoLogger infoLogger,
ConditionalExecution owner)
Handles the exception.
|
static boolean |
hasAllExceptions(String exception,
String message)
Checks if message contains all exceptions.
|
boolean |
isSavePoint()
Checks if save point on exception enabled.
|
void |
log(InfoLogger infoLogger,
Exception ex,
String logMessage)
Log.
|
void |
setExceptionMask(String value)
Sets the exception mask.
|
void |
setKeyFields(String value)
Sets the name of the key fields.
|
void |
setMessage(String value)
Sets the message displayed on exception.
|
void |
setName(String value)
Sets the name.
|
void |
setOnExceptionAction(int value)
Sets the on exception action.
|
void |
setOnExceptionAction(String type)
Sets the on exception action using given on exception type.
|
void |
setSavePoint(boolean value)
Sets the save point on exception.
|
getConditionCode, getConditionConnectionName, getConditionLang, getDefaultConnectionName, getIdForException, setConditionCode, setConditionConnectionName, setConditionLang
public static final int ON_EXCEPTION_RAISE
public static final int ON_EXCEPTION_IGNORE
public static final int ON_EXCEPTION_CONTINUE
public static final int ON_EXCEPTION_MERGE
public static final int ON_PARSE_EXCEPTION
public static final Integer ON_EXCEPTION_RAISE_KEY
public static final String ON_EXCEPTION_RAISE_STR
public static final String ON_EXCEPTION_IGNORE_STR
public static final String ON_EXCEPTION_CONTINUE_STR
public static final String ON_EXCEPTION_MERGE_STR
public static final String ON_PARSE_EXCEPTION_STR
public static final Map<String,Integer> ON_EXCEPTION
public static final Map<Integer,String> ON_EXCEPTION_TYPE
public static int findException(String exception, String message)
exception
- the exception string. It is possible to use ";" to separate
exceptionsmessage
- the message to findpublic static boolean hasAllExceptions(String exception, String message)
exception
- the semicolon-separated list of exceptionsmessage
- the messagepublic List<Integer> getExceptionActions()
public String getExceptionMask()
public String getKeyFields()
public String getMessage()
public String getName()
public int getOnExceptionAction()
public int getOnExceptionActions(String type)
type
- the typepublic void log(InfoLogger infoLogger, Exception ex, String logMessage)
infoLogger
- the info loggerex
- Exception the exception to loglogMessage
- the log messagepublic int handleException(Connection conn, String sql, Exception ex, long row, MergeHandler mergeHandler, InfoLogger infoLogger, ConditionalExecution owner) throws Exception
conn
- the connectionsql
- the currently executed sql statementex
- the exceptionrow
- the current data set rowmergeHandler
- the merge handlerinfoLogger
- the info loggerowner
- the ownerException
- in case of any errorpublic boolean isSavePoint()
public void setExceptionMask(String value)
value
- the new exception maskpublic void setKeyFields(String value)
value
- the new names of the key fieldspublic void setMessage(String value)
value
- the new messagepublic void setName(String value)
value
- the new namepublic void setOnExceptionAction(int value)
value
- the new on exception actionpublic void setOnExceptionAction(String type)
type
- the on exception typepublic void setSavePoint(boolean value)
value
- the new save point on exceptionCopyright © 2010-2020 Toolsverse. All Rights Reserved.