FileDocCategorySizeDatePackage
NullExpression.javaAPI DocHibernate 3.2.51191Sat Feb 12 00:19:50 GMT 2005org.hibernate.criterion

NullExpression

public class NullExpression extends Object implements Criterion
Constrains a property to be null
author
Gavin King

Fields Summary
private final String
propertyName
private static final org.hibernate.engine.TypedValue[]
NO_VALUES
Constructors Summary
protected NullExpression(String propertyName)


	   
		this.propertyName = propertyName;
	
Methods Summary
public org.hibernate.engine.TypedValue[]getTypedValues(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)

		return NO_VALUES;
	
public java.lang.StringtoSqlString(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)

		String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);
		String result = StringHelper.join(
			" and ",
			StringHelper.suffix( columns, " is null" )
		);
		if (columns.length>1) result = '(" + result + ')";
		return result;

		//TODO: get SQL rendering out of this package!
	
public java.lang.StringtoString()

		return propertyName + " is null";