All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.vkorobkov.jfixtures.sql.SqlBridge Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.github.vkorobkov.jfixtures.sql;

import com.github.vkorobkov.jfixtures.instructions.*;
import lombok.AllArgsConstructor;

import java.util.Collection;

@AllArgsConstructor
public class SqlBridge implements InstructionVisitor {
    private final Sql sql;
    private final Appender appender;

    public void apply(Collection instructions) {
        instructions.forEach(instruction -> instruction.accept(this));
    }

    @Override
    public void visit(CleanTable cleanTable) {
        sql.cleanTable(appender, cleanTable);
    }

    @Override
    public void visit(InsertRow insertRow) {
        sql.insertRow(appender, insertRow);
    }

    @Override
    public void visit(CustomSql customSql) {
        sql.addCustomSql(appender, customSql);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy