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

NotNullExpression

public class NotNullExpression extends Object implements Criterion
Constrains a property to be non-null
author
Gavin King

Fields Summary
private final String
propertyName
private static final org.hibernate.engine.TypedValue[]
NO_VALUES
Constructors Summary
protected NotNullExpression(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(
			" or ",
			StringHelper.suffix( columns, " is not null" )
		);
		if (columns.length>1) result = '(" + result + ')";
		return result;

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

		return propertyName + " is not null";