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

com.jn.sqlhelper.dialect.expression.StatementExpression Maven / Gradle / Ivy

package com.jn.sqlhelper.dialect.expression;

import com.jn.langx.el.expression.BaseExpression;
import com.jn.langx.util.Objs;
import com.jn.langx.util.hash.HashCodeBuilder;

public class StatementExpression extends BaseExpression implements SQLExpression {
    private String statement;

    public StatementExpression() {
    }

    public StatementExpression(String statement) {
        setStatement(statement);
    }

    public void setStatement(String statement) {
        this.statement = statement;
    }

    public String getStatement(){
        return this.statement;
    }

    @Override
    public StatementExpression execute() {
        return this;
    }
    @Override
    public boolean equals(Object obj) {
        if(obj==null){
            return false;
        }
        if(obj.getClass()!= StatementExpression.class){
            return false;
        }
        StatementExpression that = (StatementExpression)obj;
        if(!Objs.equals(this.toString(), that.toString())){
            return false;
        }
        return true;

    }
    @Override
    public int hashCode() {
        return new HashCodeBuilder().with(statement).build();
    }

    @Override
    public String toString() {
        return statement;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy