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

com.easy.query.api4j.insert.AbstractEntityInsertable Maven / Gradle / Ivy

There is a newer version: 2.3.3
Show newest version
package com.easy.query.api4j.insert;

import com.easy.query.core.basic.api.insert.ClientInsertable;
import com.easy.query.core.enums.SQLExecuteStrategyEnum;

import java.util.Collection;
import java.util.function.Function;

/**
 * create time 2023/6/2 16:15
 * 文件说明
 *
 * @author xuejiaming
 */
public abstract class AbstractEntityInsertable implements EntityInsertable {
    private final ClientInsertable clientInsertable;

    public AbstractEntityInsertable(ClientInsertable clientInsertable) {

        this.clientInsertable = clientInsertable;
    }

    @Override
    public EntityInsertable insert(T entity) {
        clientInsertable.insert(entity);
        return this;
    }

    @Override
    public EntityInsertable insert(Collection entities) {
        clientInsertable.insert(entities);
        return this;
    }

    @Override
    public long executeRows(boolean fillAutoIncrement) {
        return clientInsertable.executeRows(fillAutoIncrement);
    }

    @Override
    public EntityInsertable noInterceptor() {
        clientInsertable.noInterceptor();
        return this;
    }

    @Override
    public EntityInsertable useInterceptor(String name) {
        clientInsertable.useInterceptor(name);
        return this;
    }

    @Override
    public EntityInsertable noInterceptor(String name) {
        clientInsertable.noInterceptor(name);
        return this;
    }

    @Override
    public EntityInsertable useInterceptor() {
        clientInsertable.useInterceptor();
        return this;
    }

    @Override
    public EntityInsertable setSQLStrategy(boolean condition, SQLExecuteStrategyEnum sqlStrategy) {
        clientInsertable.setSQLStrategy(condition, sqlStrategy);
        return this;
    }

    @Override
    public EntityInsertable asTable(Function tableNameAs) {
        clientInsertable.asTable(tableNameAs);
        return this;
    }

    @Override
    public EntityInsertable asSchema(Function schemaAs) {
        clientInsertable.asSchema(schemaAs);
        return this;
    }

    @Override
    public EntityInsertable asAlias(String alias) {
        clientInsertable.asAlias(alias);
        return this;
    }

    @Override
    public String toSQL(Object entity) {
        return clientInsertable.toSQL(entity);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy