Search in sources :

Example 1 with DQLExecutionEvent

use of com.dangdang.ddframe.rdb.sharding.executor.event.DQLExecutionEvent in project sharding-jdbc by dangdangdotcom.

the class EventPostman method postExecutionEventsAfterExecution.

void postExecutionEventsAfterExecution(final AbstractExecutorWrapper statementExecutorWrapper, final EventExecutionType eventExecutionType, final Optional<SQLException> exp) {
    if (statementExecutorWrapper.getDMLExecutionEvent().isPresent()) {
        DMLExecutionEvent event = statementExecutorWrapper.getDMLExecutionEvent().get();
        event.setEventExecutionType(eventExecutionType);
        event.setExp(exp);
        DMLExecutionEventBus.post(event);
    } else if (statementExecutorWrapper.getDQLExecutionEvent().isPresent()) {
        DQLExecutionEvent event = statementExecutorWrapper.getDQLExecutionEvent().get();
        event.setEventExecutionType(eventExecutionType);
        event.setExp(exp);
        DQLExecutionEventBus.post(event);
    }
}
Also used : DMLExecutionEvent(com.dangdang.ddframe.rdb.sharding.executor.event.DMLExecutionEvent) DQLExecutionEvent(com.dangdang.ddframe.rdb.sharding.executor.event.DQLExecutionEvent)

Aggregations

DMLExecutionEvent (com.dangdang.ddframe.rdb.sharding.executor.event.DMLExecutionEvent)1 DQLExecutionEvent (com.dangdang.ddframe.rdb.sharding.executor.event.DQLExecutionEvent)1