org.mentabean.sql.conditions.Between Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of menta-bean Show documentation
Show all versions of menta-bean Show documentation
An query helper and simple CRUD ORM.
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();
}
}