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

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

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

import org.mentabean.sql.param.Param;

public class Between extends AbstractBetween {

	public Between(Param begin, Param end) {
		super(begin, end);
	}
	
	public Between(Object beginValue, Object endValue) {
		super(beginValue, endValue);
	}
	
	@Override
	public String build() {
		
		if (begin == null && end == null)
			return "";
		
		if (begin == null) {
			return new LessThanEquals(end).build();
		}
		if (end == null) {
			return new GreaterThanEquals(begin).build();
		}
		
		return "BETWEEN "+begin.paramInQuery()+" AND "+end.paramInQuery();
	}
	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy