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

com.hecloud.runtime.database.builder.BatchSQLBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
package com.hecloud.runtime.database.builder;

import com.hecloud.runtime.common.exception.DatabaseException;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * 批量脚本构造接口
 *
 * @author LoveinBJ
 */
public interface BatchSQLBuilder {
    /**
     * 构建批量插入数值
     *
     * @param objects 对象列表
     * @return values 字符串
     * @throws DatabaseException 数据库异常
     */
    String buildValues(List objects) throws DatabaseException;

    /**
     * 构建批量操作前缀语句
     *
     * @return 前缀语句
     * @throws DatabaseException 数据库异常
     */
    String buildPrefix() throws DatabaseException;

    /**
     * 默认包围方法
     *
     * @param value 被包围值
     * @return 结果
     */
    default String around(String value) {
        if (StringUtils.isNotBlank(value)) {
            return "'" + value + "'";
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy