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

com.github.antelopeframework.mybatis.criterion.NullExpression 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 be null
 * 
 * @author yangzhi.yzh
 *
 */
@Getter
public class NullExpression implements Criterion {
	private static final long serialVersionUID = 1L;

	private final String column;
	
	/**
	 * Constructs a NullExpression
	 *
	 * @param column The name of the property to check for null
	 *
	 * @see Restrictions#isNull
	 */
	protected NullExpression(String column) {
		this.column = column;
	}
	
	@Override
	public String toSqlString(CriteriaQuery criteriaQuery) {
		return column + " is null";
	}

	@Override
	public TypedValue[] getTypedValues(CriteriaQuery criteriaQuery) {
		return NO_VALUES;
	}
	
	@Override
	public String toString() {
		return column + " is null";
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy