com.jpattern.orm.query.clause.where.BinaryExpressionElement Maven / Gradle / Ivy
package com.jpattern.orm.query.clause.where;
import java.util.List;
import com.jpattern.orm.query.NameSolver;
import com.jpattern.orm.query.SmartRenderableSqlSubElement;
/**
*
* @author Francesco Cina
*
* 26/giu/2011
*/
public abstract class BinaryExpressionElement extends SmartRenderableSqlSubElement implements ExpressionElement{
/**
*
*/
private final String relationType;
protected final ExpressionElement expressionOne;
protected final ExpressionElement expressionTwo;
public BinaryExpressionElement(final ExpressionElement expressionOne, final ExpressionElement expressionTwo, final String relationType) {
this.expressionOne = expressionOne;
this.expressionTwo = expressionTwo;
this.relationType = relationType;
}
@Override
public final int getElementStatusVersion() {
return 0;
}
@Override
public final void doElementRender(final StringBuilder stringBuilder) {
stringBuilder.append("( ");
this.expressionOne.renderSqlElement(stringBuilder);
stringBuilder.append(this.relationType);
this.expressionTwo.renderSqlElement(stringBuilder);
stringBuilder.append(") ");
}
@Override
public void setNameSolver(final NameSolver nameSolver) {
this.expressionOne.setNameSolver(nameSolver);
this.expressionTwo.setNameSolver(nameSolver);
}
@Override
public final void appendElementValues(final List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy