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

org.mentabean.sql.conditions.Equals Maven / Gradle / Ivy

There is a newer version: 2.2.4
Show newest version
package org.mentabean.sql.conditions;

import org.mentabean.sql.Condition;
import org.mentabean.sql.param.Param;
import org.mentabean.sql.param.ParamValue;

public class Equals implements Condition {

	protected Param param;
	
	public Equals(Object value) {
		if (value != null) {
			this.param = new ParamValue(value);
		}
	}
	
	public Equals(Param param) {
		this.param = param;
	}

	@Override
	public Param[] getParams() {
		return new Param[] {param};
	}

	@Override
	public String build() {
		
		if (param == null)
			return "IS NULL";
		
		return "= "+param.paramInQuery();
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy