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

xin.xihc.jba.sql.clause.Clause Maven / Gradle / Ivy

There is a newer version: 1.8.12
Show newest version
package xin.xihc.jba.sql.clause;

import xin.xihc.jba.sql.KV;

/**
 * 条件抽象类
 *
 * @author Leo.Xi
 * @date 2020/3/5
 * @since 1.0
 **/
public abstract class Clause {

    protected String columnName;
    protected T value;

    public Clause(String columnName, T value) {
        this.columnName = columnName;
        this.value = value;
    }

    /**
     * 值
     */
    public abstract T value();

    /**
     * 操作符
     */
    public abstract String operation();

    public String toSql(KV kv) {
        String key = kv.add(this.value());
        return this.columnName + this.operation() + ":" + key;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy