class MaxModificationIdVisitor extends VoidExpressionVisitor {

    private long maxDataModificationId;

    public long getMaxDataModificationId() {
        return maxDataModificationId;
    }

    public void setMaxDataModificationId(long maxDataModificationId) {
        if (maxDataModificationId > this.maxDataModificationId) {
            this.maxDataModificationId = maxDataModificationId;
        }
    }

    @Override
    public Void visitExpressionColumn(ExpressionColumn e) {
        setMaxDataModificationId(e.getColumn().getTable().getMaxDataModificationId());
        return null;
    }

    @Override
    public Void visitSequenceValue(SequenceValue e) {
        setMaxDataModificationId(e.getSequence().getModificationId());
        return null;
    }

    @Override
    protected Void visitQuery(Query query) {<FILL_FUNCTION_BODY>}
}

        super.visitQuery(query);
        for (int i = 0, size = query.getFilters().size(); i < size; i++) {
            TableFilter f = query.getFilters().get(i);
            long m = f.getTable().getMaxDataModificationId();
            setMaxDataModificationId(m);
        }
        return null;
    
<methods>public non-sealed void <init>() ,public java.lang.Void visitAGroupConcat(com.lealone.sql.expression.aggregate.AGroupConcat) ,public java.lang.Void visitAggregate(com.lealone.sql.expression.aggregate.Aggregate) ,public java.lang.Void visitAlias(com.lealone.sql.expression.Alias) ,public java.lang.Void visitCompareLike(com.lealone.sql.expression.condition.CompareLike) ,public java.lang.Void visitComparison(com.lealone.sql.expression.condition.Comparison) ,public java.lang.Void visitConditionAndOr(com.lealone.sql.expression.condition.ConditionAndOr) ,public java.lang.Void visitConditionExists(com.lealone.sql.expression.condition.ConditionExists) ,public java.lang.Void visitConditionIn(com.lealone.sql.expression.condition.ConditionIn) ,public java.lang.Void visitConditionInConstantSet(com.lealone.sql.expression.condition.ConditionInConstantSet) ,public java.lang.Void visitConditionInSelect(com.lealone.sql.expression.condition.ConditionInSelect) ,public java.lang.Void visitConditionNot(com.lealone.sql.expression.condition.ConditionNot) ,public java.lang.Void visitExpression(com.lealone.sql.expression.Expression) ,public java.lang.Void visitExpressionColumn(com.lealone.sql.expression.ExpressionColumn) ,public java.lang.Void visitExpressionList(com.lealone.sql.expression.ExpressionList) ,public java.lang.Void visitFunction(com.lealone.sql.expression.function.Function) ,public java.lang.Void visitJavaAggregate(com.lealone.sql.expression.aggregate.JavaAggregate) ,public java.lang.Void visitJavaFunction(com.lealone.sql.expression.function.JavaFunction) ,public java.lang.Void visitOperation(com.lealone.sql.expression.Operation) ,public java.lang.Void visitParameter(com.lealone.sql.expression.Parameter) ,public java.lang.Void visitRownum(com.lealone.sql.expression.Rownum) ,public java.lang.Void visitSelect(com.lealone.sql.query.Select) ,public java.lang.Void visitSelectUnion(com.lealone.sql.query.SelectUnion) ,public java.lang.Void visitSequenceValue(com.lealone.sql.expression.SequenceValue) ,public java.lang.Void visitSubQuery(com.lealone.sql.expression.subquery.SubQuery) ,public java.lang.Void visitTableFunction(com.lealone.sql.expression.function.TableFunction) ,public java.lang.Void visitValueExpression(com.lealone.sql.expression.ValueExpression) ,public java.lang.Void visitVariable(com.lealone.sql.expression.Variable) ,public java.lang.Void visitWildcard(com.lealone.sql.expression.Wildcard) <variables>