com.jpattern.orm.query.where.BinaryExpressionElement Maven / Gradle / Ivy
package com.jpattern.orm.query.where;
import java.util.List;
import com.jpattern.orm.query.INameSolver;
/**
*
* @author Francesco Cina
*
* 26/giu/2011
*/
public abstract class BinaryExpressionElement implements ExpressionElement{
/**
*
*/
private final String relationType;
protected final ExpressionElement expressionOne;
protected final ExpressionElement expressionTwo;
public BinaryExpressionElement(ExpressionElement expressionOne, ExpressionElement expressionTwo, String relationType) {
this.expressionOne = expressionOne;
this.expressionTwo = expressionTwo;
this.relationType = relationType;
}
@Override
public String renderSql() {
StringBuilder StringBuilder = new StringBuilder();
renderSql(StringBuilder);
return StringBuilder.toString();
}
@Override
public void renderSql(StringBuilder StringBuilder) {
StringBuilder.append("( ");
expressionOne.renderSql(StringBuilder);
StringBuilder.append(relationType);
expressionTwo.renderSql(StringBuilder);
StringBuilder.append(") ");
}
@Override
public void setNameSolver(INameSolver nameSolver) {
expressionOne.setNameSolver(nameSolver);
expressionTwo.setNameSolver(nameSolver);
}
@Override
public void appendValues(List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy