FileDocCategorySizeDatePackage
IdentifierProjection.javaAPI DocHibernate 3.2.51510Tue May 31 15:24:42 BST 2005org.hibernate.criterion

IdentifierProjection

public class IdentifierProjection extends SimpleProjection
A property value, or grouped property value
author
Gavin King

Fields Summary
private boolean
grouped
Constructors Summary
protected IdentifierProjection(boolean grouped)

		this.grouped = grouped;
	
protected IdentifierProjection()

		this(false);
	
Methods Summary
public org.hibernate.type.Type[]getTypes(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)

		return new Type[] { criteriaQuery.getIdentifierType(criteria) };
	
public booleanisGrouped()

		return grouped;
	
public java.lang.StringtoGroupSqlString(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)

		if (!grouped) {
			return super.toGroupSqlString(criteria, criteriaQuery);
		}
		else {
			return StringHelper.join( ", ", criteriaQuery.getIdentifierColumns(criteria) );
		}
	
public java.lang.StringtoSqlString(org.hibernate.Criteria criteria, int position, CriteriaQuery criteriaQuery)

		StringBuffer buf = new StringBuffer();
		String[] cols = criteriaQuery.getIdentifierColumns(criteria);
		for ( int i=0; i<cols.length; i++ ) {
			buf.append( cols[i] )
				.append(" as y")
				.append(position + i)
				.append('_");
		}
		return buf.toString();
	
public java.lang.StringtoString()

		return "id";