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

org.fluentjdbc.DbBulkInsertContext Maven / Gradle / Ivy

There is a newer version: 0.5.3
Show newest version
package org.fluentjdbc;

import java.util.List;
import java.util.function.Function;

public class DbBulkInsertContext implements DatabaseBulkUpdateable> {

    private final DbTableContext tableContext;
    private DatabaseBulkInsertBuilder builder;

    public DbBulkInsertContext(DbTableContext tableContext, DatabaseBulkInsertBuilder builder) {
        this.tableContext = tableContext;
        this.builder = builder;
    }

    @Override
    public DbBulkInsertContext setField(String fieldName, Function transformer) {
        return build(builder.setField(fieldName, transformer));
    }

    @Override
    public > DbBulkInsertContext setFields(List fields, Function values) {
        return build(builder.setFields(fields, values));
    }

    private DbBulkInsertContext build(DatabaseBulkInsertBuilder builder) {
        return this;
    }

    public int execute() {
        return builder.execute(tableContext.getConnection());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy