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

com.github.chengyuxing.sql.dsl.clause.condition.Condition Maven / Gradle / Ivy

Go to download

Light wrapper of JDBC, support ddl, dml, query, plsql/procedure/function, transaction and manage sql file.

There is a newer version: 9.0.2
Show newest version
package com.github.chengyuxing.sql.dsl.clause.condition;

import com.github.chengyuxing.sql.dsl.types.Operator;

public class Condition implements Criteria {
    protected final String column;
    protected final Operator operator;
    protected final T value;
    protected final String valueKey;

    public Condition(String column, Operator operator, T value) {
        this.column = column;
        this.operator = operator;
        this.value = value;
        this.valueKey = column;
    }

    public Condition(String column, Operator operator, T value, String valueKey) {
        this.column = column;
        this.operator = operator;
        this.value = value;
        this.valueKey = valueKey;
    }

    public String getColumn() {
        return column;
    }

    public Operator getOperator() {
        return operator;
    }

    public Object getValue() {
        return value;
    }

    public String getKey(int index) {
        return valueKey + "__" + index;
    }

    @Override
    public String toString() {
        return "Condition{" +
                "column='" + column + '\'' +
                ", operator=" + operator +
                ", value=" + value +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy