use of org.jkiss.dbeaver.model.qm.meta.QMMObject in project dbeaver by serge-rider.
the class TransactionInfoDialog method createContextFilter.
protected QMEventFilter createContextFilter(DBCExecutionContext executionContext) {
if (executionContext == null) {
return VOID_FILTER;
}
final boolean showAll = showAllCheck != null && showAllCheck.getSelection();
final boolean showPrevious = showPreviousCheck != null && showPreviousCheck.getSelection();
final QMMSessionInfo currentSession = QMUtils.getCurrentSession(executionContext);
final QMMTransactionSavepointInfo currentSP = QMUtils.getCurrentTransaction(executionContext);
QMEventFilter filter = new QMEventFilter() {
@Override
public boolean accept(QMMetaEvent event) {
QMMObject object = event.getObject();
if (object instanceof QMMStatementExecuteInfo) {
QMMStatementExecuteInfo exec = (QMMStatementExecuteInfo) object;
if (!showPrevious && exec.getSavepoint() != currentSP) {
return false;
}
if (exec.getStatement().getSession() != currentSession) {
return false;
}
return (showAll || exec.isTransactional());
}
return false;
}
};
return filter;
}
Aggregations