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

com.jpattern.orm.query.where.NotExpressionElement Maven / Gradle / Ivy

There is a newer version: 3.5.1
Show newest version
package com.jpattern.orm.query.where;

import java.util.List;

import com.jpattern.orm.query.INameSolver;

/**
 * 
 * @author Francesco Cina
 *
 * 26/giu/2011
 */
public class NotExpressionElement implements ExpressionElement {

	
	
	/**
	 * 
	 */
	
	protected final ExpressionElement expression;

	public NotExpressionElement(ExpressionElement expression) {
		this.expression = expression;
	}

	@Override
	public String renderSql() {
		StringBuilder StringBuilder = new StringBuilder();
		renderSql(StringBuilder);
		return StringBuilder.toString();
	}

	@Override
	public void renderSql(StringBuilder StringBuilder) {
		StringBuilder.append("NOT ( ");
		expression.renderSql(StringBuilder);
		StringBuilder.append(") ");
	}

	@Override
	public void setNameSolver(INameSolver nameSolver) {
		expression.setNameSolver(nameSolver);
	}

	@Override
	public void appendValues(List values) {
		expression.appendValues(values);
	}

}