private void postExecutionEvents() { for (StatementExecutorWrapper each : statementExecutorWrappers) { if (each.getDMLExecutionEvent().isPresent()) { DMLExecutionEventBus.post(each.getDMLExecutionEvent().get()); } else if (each.getDQLExecutionEvent().isPresent()) { DQLExecutionEventBus.post(each.getDQLExecutionEvent().get()); } } }
private void postExecutionEventsAfterExecution( final StatementExecutorWrapper 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); } }
private ResultSet executeQueryInternal( final StatementExecutorWrapper statementExecutorWrapper, final boolean isExceptionThrown, final Map<String, Object> dataMap) { ResultSet result; ExecutorExceptionHandler.setExceptionThrown(isExceptionThrown); ExecutorDataMap.setDataMap(dataMap); try { result = statementExecutorWrapper .getStatement() .executeQuery(statementExecutorWrapper.getSqlExecutionUnit().getSql()); } catch (final SQLException ex) { postExecutionEventsAfterExecution( statementExecutorWrapper, EventExecutionType.EXECUTE_FAILURE, Optional.of(ex)); ExecutorExceptionHandler.handleException(ex); return null; } postExecutionEventsAfterExecution(statementExecutorWrapper); return result; }