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

io.github.wycst.wast.jdbc.executer.BetweenFieldCondition Maven / Gradle / Ivy

Go to download

Wast is a high-performance Java toolset library package that includes JSON, YAML, CSV, HttpClient, JDBC and EL engines

There is a newer version: 0.0.20
Show newest version
package io.github.wycst.wast.jdbc.executer;

import java.io.Serializable;
import java.util.List;

class BetweenFieldCondition extends FieldCondition {

    final Serializable left;
    final Serializable right;

    public BetweenFieldCondition(String field, Serializable left, Serializable right) {
        super(field, null);
        left.getClass();
        right.getClass();
        this.left = left;
        this.right = right;
    }

    @Override
    public String getOperator() {
        return "BETWEEN";
    }

    @Override
    public void appendWhereValue(StringBuilder whereBuilder, List paramValues, Object conditionValue) {
        whereBuilder.append("? AND ?");
        paramValues.add(left);
        paramValues.add(right);
    }

    @Override
    public Serializable getValue() {
        return 1;
    }
}