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

IdentifierEqExpression

public class IdentifierEqExpression extends Object implements Criterion
An identifier constraint
author
Gavin King

Fields Summary
private final Object
value
Constructors Summary
protected IdentifierEqExpression(Object value)

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

		return new TypedValue[] { criteriaQuery.getTypedIdentifierValue(criteria, value) };
	
public java.lang.StringtoSqlString(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)


		String[] columns = criteriaQuery.getIdentifierColumns(criteria);

		String result = StringHelper.join(
			" and ",
			StringHelper.suffix( columns, " = ?" )
		);
		if (columns.length>1) result = '(" + result + ')";
		return result;

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

		return "id = " + value;