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

com.github.antelopeframework.mybatis.criterion.BetweenExpression Maven / Gradle / Ivy

There is a newer version: 1.1.5
Show newest version
package com.github.antelopeframework.mybatis.criterion;

import lombok.Getter;

/**
 * Constrains a property to between two values
 * 
 * @author yangzhi.yzh
 */
@Getter
public class BetweenExpression implements Criterion {
	private static final long serialVersionUID = 1L;

	private final String column;
	private final Object lo;
	private final Object hi;

	protected BetweenExpression(String column, Object lo, Object hi) {
		this.column = column;
		this.lo = lo;
		this.hi = hi;
	}

	@Override
	public String toSqlString(CriteriaQuery criteriaQuery) {
		return column + " between ? and ?";
	}

	@Override
	public TypedValue[] getTypedValues(CriteriaQuery criteriaQuery) {
		return new TypedValue[] { new TypedValue(null, lo), new TypedValue(null, hi) };
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy